.netvisual-c++dlldependency-managementbadimageformatexception

BadImageFormatException on 32bit app running on 64bit PC


I'm developing a .NET C++ application. I'm using a fingerprint's sensor whose main library only works on 32bits, and has many dependencies, one of them is msvcr110.dll. I know that this DLL comes with VS C++ Redistributable Package 2012, so I installed it.

However, when I run the app I'm getting BadImageFormat exception. I opened the DLL with Dependency Walker, and I saw that it's finding msvcr110.dll / msvcr110d.dll on Windows/System32's folder, but in Dependency Walker the DLL appears with 64bit format. This has no sense for me, as it was loaded from System32 folder.

If I open msvcr110.dll with Dependency Walker, it appears as 32bit. Why when the fingerprint's sensor loads the library it load it as 64bits?

Any ideas to fix this? Thanks so much


Solution

  • Thanks for your response :) Finally, I take the fast way and I installed Visual Studio 2012 in order to get msvcr110d.dll. Then, I copied both dlls to my program path, and it worked... But yes, your option seems better as it does not require to use debug dlls.