I must call a 32bit unmanaged DLL from an external provider from my C# WinForms project.
However I must build my C# project as "Any CPU" to take advantage of the greater memory on 64bit computers.
Therefore, when I try to call the 32bit DLL from a machine running 64bit, I get this error:
BadImageFormatException : An attempt was made to load a program with an incorrect format
Changing the build to target x86 is not an option for us.
We do not have any ability to modify the external DLL itself.
How can I get around this error?