I\'m calling functions from a 32-bit unmanaged DLL on a 64-bit system. What I get is:
BadImageFormatException: An attempt was made to load a program w
I was able to fix this issue by matching my build version to the .NET version on the server.
I double clicked the .exe just to see what would happen and it told me to install 4.5....
So I downgraded to 4.0 and it worked!
So make sure your versions match. It ran on my dev box fine, but server had older .NET version.