【问题标题】:Could not load file or assembly in Visual Studio 2010无法在 Visual Studio 2010 中加载文件或程序集
【发布时间】:2014-02-12 05:25:38
【问题描述】:

我的项目使用另一个 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."

【问题讨论】:

标签: c# .net visual-studio-2010 badimageformatexception


【解决方案1】:

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

【讨论】:

  • 你是正确的先生,你
【解决方案2】:

我认为这与64bit and 32bit DLL 构建和处理的差异有关。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-02-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-09
    相关资源
    最近更新 更多