ASP.NET的P / Invoke"试图加载程序格式不正确" [英] ASP.NET P/Invoke "An attempt was made to load a program with an incorrect format"

查看:189
本文介绍了ASP.NET的P / Invoke"试图加载程序格式不正确"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个P /调用32位的DLL的ASP.NET应用程序。

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

当我部署它在64位服务器上我得到了错误试图加载程序格式不正确。

When i deployed it on a 64-bit server i got the error "An attempt was made to load a program with an incorrect format".

然后我将IIS配置为运行32位按照给出的指令<一个href=\"http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/405f5bb5-87a3-43d2-8138-54b75db73aa1.mspx?mfr=true\"相对=nofollow>此处。仍然得到同样的错误。

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

还有什么比这里是什么问题?

What could be the problem here?

推荐答案

这只是的允许的32位应用程序运行,但它简化版,做任何事情,实际上是在32位模式下运行。

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

要使用32位的DLL,您的Web应用程序必须在32位模式,这是由IIS切换到32位模式下运行完成运行。但是,这取决于其他Web应用程序在服务器上运行,因为这可能不是实际可行的所有的Web应用程序必须在32位模式下运行。还有就是你链接到页面,即有大约运行IIS的在32位模式的影响的详细信息的链接。

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.

如果您不能于swtich在32位模式下运行IIS,你将需要DLL的一个64位版本来使用它。

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.

这篇关于ASP.NET的P / Invoke&QUOT;试图加载程序格式不正确&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆