.net Framework Error (HRESULT 0x8007000B)

While your main app might be built for AnyCPU are you sure all the assemblies are AnyCPU? Do you have any native assemblies or assemblies that contain native code? Are they built against x86?

file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll

This tells me that the app is running as an x64 process but it would appear that there is some assembly that isn’t AnyCPU or x64 which is likely the cause of the BadImageFormatException.

One thing you can try is to run the application from a 32-bit command prompt (c:\windows\SysWow64\cmd.exe) to force it to be a 32-bit process and see if that works. If that works then there is definitely some assembly that is not AnyCPU.

Leave a Comment