您的位置:首页 > 其它

An attempt was made to load a program with an incorrect format” even when the platforms are the same

2012-12-10 16:40 423 查看
下面我说下这个错误的几种解决办法。如果前2个方法还不能解决你的问题。那么请试下第三条。

1.If you try to run 32-bit applications on IIS7 (and/or 64-bit OS machine) you will get the same error. So, from the IIS7 right click on the applications' application pool and go to "advanced settings" and change "Enable 32-Bit Applications" to "TRUE".

Restart your Website and it should work.

2. Somehow, the Build checkbox in the Configuration Manager had been unchecked for my executable, so it was still running with the old Any CPU build. After I fixed that, Visual Studio complained that it couldn't debug the assembly, but that
was fixed with a restart.

具体请参考: stackoverflow

3. 如果你当前的应用程序在debug模式下可以正常使用,但是你一但publish你的这些dll。他们将不能正常使用,即使你把所有文件都拷贝到指定的虚拟目录。这个时候你需要考虑下你的线程池的配置。尤其是Indentiy的设置。可以尝试用Networkservice。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐