简体   繁体   中英

Could not load file or assembly in Visual Studio 2010

My project uses another lib project as reference.

I get this error when trying to run a project in "Relase" Mode, In "Debug" Mode it works fine.

It says that it cannot load the lib project because :

"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."

BadImageFormatException means 32/64 bit mismatch. Check your project configurations. The x86/x64/Any CPU settings must be messed up among Debug and Release configurations.

I think this is related to the difference in 64bit and 32bit DLL builds and processes.

Try compiling to 32bit by changing project properties/Build/Platform Target .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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