2

我的项目使用另一个 lib 项目作为参考。

尝试在“发布”模式下运行项目时出现此错误,在“调试”模式下它工作正常。

它说它无法加载 lib 项目,因为:

"An unhandled exception of type 'System.BadImageFormatException' occurred in mscorlib.dll

Additional information: Could not load file or assembly 'UserManagementProviders,     
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. 
An attempt was made to load a program with an incorrect format."
4

2 回答 2

6

BadImageFormatException 表示 32/64 位不匹配。检查您的项目配置。x86/x64/Any CPU 设置必须在 Debug 和 Release 配置中搞乱。

于 2014-01-22T08:54:45.113 回答
0

我认为这与64bit and 32bitDLL 构建和进程的差异有关。

尝试通过更改编译为 32 位project properties/Build/Platform Target

于 2014-01-22T09:04:16.817 回答