无法加载文件或程序集异常 [英] Could not load file or assembly exception
问题描述
对可能导致此异常的原因有任何想法吗?
Any thoughts on what might be causing this exception?
我有一个网络服务项目,当我加载我得到的链接
I have a webservice proj, when i load the link i get
无法加载文件或程序集Interop.DIB"或其依赖项之一.试图加载格式不正确的程序.
异常详细信息:System.BadImageFormatException:无法加载文件或程序集Interop.DIB"或其依赖项之一.试图加载格式不正确的程序.
Could not load file or assembly 'Interop.DIB' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'Interop.DIB' or one of its dependencies. An attempt was made to load a program with an incorrect format.
内部异常:
[BadImageFormatException: 无法加载文件或程序集Interop.DIB"或其依赖项之一.试图加载格式不正确的程序.]
[BadImageFormatException: Could not load file or assembly 'Interop.DIB' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
[ConfigurationErrorsException: 无法加载文件或程序集Interop.DIB"或其依赖项之一.试图加载格式不正确的程序.]
[ConfigurationErrorsException: Could not load file or assembly 'Interop.DIB' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
[HttpException (0x80004005): 无法加载文件或程序集Interop.DIB"或其依赖项之一.试图加载格式不正确的程序.]
[HttpException (0x80004005): Could not load file or assembly 'Interop.DIB' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
版本信息:
Microsoft .NET Framework 版本:4.0.30319;ASP.NET 版本:4.0.30319.272
Version Information:
Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
推荐答案
好的答案是 Got to Start->Run->type inetmgr 并在左侧的应用程序池中,选择 DefaultAppPool 和应用程序的虚拟目录名称并为两者都确保将 32 位应用程序启用为 true,我使用的是 IIS7.0 和 Windows 7 64 位.
Ok the answer is Got to Start->Run->type inetmgr and on the left application pools, select DefaultAppPool and the virtual directory name of the app and for both make sure to enable 32 -bit applications to true, am using IIS7.0 and windows 7 64-bit.
这篇关于无法加载文件或程序集异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!