开发者

ASP.NET P/Invoke "An attempt was made to load a program with an incorrect format"

I have an ASP.NET application that P/Invokes a 32-bit DLL.

When i deployed it on a 64-bit server i go开发者_Python百科t the error "An attempt was made to load a program with an incorrect format".

Then i configured IIS to run 32-bit as per instructions given here. Still get the same error.

What could be the problem here?


That only allows 32 bit applications to run, but it does't make anything actually run in 32 bit mode.

To use the 32 bit dll, your web application has to run in 32 bit mode, which is done by switching IIS to run in 32 bit mode. However, that might not be practically possible depending on what other web applications run on the server, as all web applications have to run in 32 bit mode. There is a link on the page that you linked to, that has more information about the implications of running IIS in 32 bit mode.

If you can't swtich to run IIS in 32 bit mode, you will need a 64 bit version of the dll to use it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜