[英]Using c++ dll in asp.net - Exception:Could not load file or assembly
I am using a already developed C++ dll in my asp.net code to make compression/decompression of the data. 我在asp.net代码中使用已经开发的C ++ dll进行数据压缩/解压缩。 It works well on my developer machine and some other machines too.
它在我的开发人员机器和其他一些机器上也能很好地工作。 I have a client machine which is fresh(No fancy installation of various tools) and When it tries to call that dll it generates an exception.
我有一台新的客户机(没有花哨的安装各种工具),当它尝试调用该dll时会生成异常。
Exception: Could not load file or assembly 'dllcode, Version=1.0.5754.25819, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
例外:
Could not load file or assembly 'dllcode, Version=1.0.5754.25819, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Could not load file or assembly 'dllcode, Version=1.0.5754.25819, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
I would like to know that which dependencies are missing on Client fresh machine? 我想知道客户端新鲜机器上缺少哪些依赖项?
Note: I am trying to call C++ dll in a windows service which is having asp.net 4.0 framework. 注意:我正在尝试在具有asp.net 4.0框架的Windows服务中调用C ++ dll。 This call is executing perfectly on my developer machine but generates above exception on my client machine.I do not have deep knowledge about c++ library and it's dll.
该调用在我的开发人员机器上执行完美,但是在我的客户端机器上生成了上述异常。我对c ++库及其dll没有深入的了解。 From basic troubleshooting I tried to install various combinations of "microsoft visual c++ 2010 runtime" but it did not help.
从基本的疑难解答中,我尝试安装“ Microsoft Visual C ++ 2010运行时”的各种组合,但没有帮助。
Update : Somehow I find source code of this C++ dll and now I am trying to check if I can build this dll any version specific. 更新 :不知何故我找到了这个C ++ dll的源代码,现在我试图检查是否可以构建任何特定版本的dll。
I got this resolved. 我解决了。 What I did is, I had to create separate setups(32-Bit & 64-Bit).
我要做的是,我必须创建单独的设置(32位和64位)。 Also VC++ run time was needed on server.
服务器上还需要VC ++运行时。 So I installed them and it worked.
因此,我安装了它们,并成功了。 Hope this help to any one if he faces the same issue.
如果他面临同样的问题,希望对任何人有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.