I am working on a .NET 3.5 console application in C # that uses an unmanaged DLL version of VC ++. It worked without problems when I worked on it a few weeks ago, but now I return to it and now I get a BadImageFormatException exception ("An attempt was made to load a program with the wrong format" (Exception from HRESULT: 0x8007000B)).
My development workstation runs on 64-bit Windows 7, and I do a lot of work with unmanaged code, so I immediately noticed that the .NET assembly and the VC ++ library had x86 targets. They did.
To be sure, I cleaned and rebuilt the VC ++ library and .NET assembly, but to no avail.
No system does anything particularly unusual. The VC ++ library loads the binary data file and performs some mathematical processing of the content. The .NET compilation has DllImports for the library and some code to connect it. All this worked a few weeks ago.
So, now I have to wonder whether there is another reason for the BadImageFormatException exception, which is less common than the x86 / x64 conflict I could work with.
Thanks.
EDIT: I get the same error, regardless of the x86 or x64 mode, but when "Any processor" is installed, the execution passes this point, but the execution is interrupted when the VC ++ library is subsequently called without exception. Regardless of whether this is due to this problem, is there something that βany processorβ is different from x86 and x64 that can shed light on this?
c ++ c # visual-studio-2008 visual-studio dllimport
Phillip knauss
source share