简体   繁体   English

部署x64 ASP.NET Web应用程序时无法加载程序集错误

[英]Unable to load assembly error deploying x64 ASP.NET web application

I have developed an ASP.NET web application consisting only of generic http handlers. 我已经开发了仅由通用http处理程序组成的ASP.NET Web应用程序。 I started on a x86 development machine tested locally using IISExpress, then deployed on a 32bit Windows 2003 Server with IIS6.0, and everything went well. 我从使用IISExpress在本地测试的x86开发计算机上开始,然后将其部署在具有IIS6.0的32位Windows 2003 Server上,一切进行得很好。

My company decided to update to an x64 environment in order to take advantage of some third party libraries that are optimized for 64bit environments, hence we switched to a 64bit Windows Server 2012 R2 std edition, but I'm having some troubles. 为了利用某些针对64位环境进行了优化的第三方库,我公司决定更新到x64环境,因此我们切换到了64位Windows Server 2012 R2 std版,但遇到了一些麻烦。

On my local machine, now switched to a x64 dev machine with platform target set to x64 everything goes well, but when deploying on the server I always get 在我的本地计算机上,现在切换到平台目标设置为x64的x64开发人员机器,一切正常,但是在服务器上进行部署时,我总是得到

System.BadImageFormatException System.BadImageFormatException

on the main assembly. 在主组件上。 Other part of the error message says that the assembly manager is loaded by 错误消息的其他部分显示程序集管理器是通过以下方式加载的

C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\clr.dll C:\\ WINDOWS \\ Microsoft.NET \\框架\\ v4.0.30319 \\ clr.dll

and it is executed with 它与执行

C:\\Windows\\SysWOW64\\inetsrv\\w3wp.exe C:\\ WINDOWS \\ Syswow64资料\\ INETSRV \\程序w3wp.exe

Since SysWOW64 it is needed to run 32bit applications inside 64bit environments, it is possible that IIS server on the production machine is not enabled to run x64 web applications? 由于SysWOW64需要在64位环境中运行32位应用程序,因此可能无法在生产计算机上启用IIS服务器来运行x64 Web应用程序吗? If so what should I do to overcome this issue, knowing that I do not have direct access to the server. 如果是这样,我知道我没有直接访问服务器的权限,那么该如何解决该问题。

Thank you. 谢谢。

The error and the paths: 错误和路径:

C:\Windows\SysWOW64\inetsrv\w3wp.exe

and

C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll

...definitely prove that the production server you're deploying to is running its website application pools in 32 bit mode, or certainly yours anyway. ...绝对证明您要部署到的生产服务器正在以32位模式运行其网站应用程序池,或者肯定是您自己的。

As a web hoster we do the same for a bunch of legacy reasons. 作为网络托管服务商,出于许多传统原因,我们都这样做。 Have a word and see if they'll flip it back to native 64 bit mode. 说一句话,看看他们是否会将其翻转回本机64位模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM