I have a written a manged C++/CLI DLL wrapper around an unmanaged C++ shared library and I've referenced this DLL in a C# console application. Everything builds correctly.
This code had previously been running on Windows XP 32-bit. Now when I build everything with target type x64 on a Windows XP 64bit machine, I get the following exception at startup:
Could not load file or assembly X (the Managed Wrapper) or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1).
I've tried building with various settings: x86, mixed assemblies, win32, x64 but the application fails to run each time.
Why would I be getting this error about the assembly not being a valid win32 application when I'm building on XP 64bit with target type x64?
I'm working in Visual Studio 2010 on Windows XP 64bit. I'm also referencing libmysql.dll (both 32-bit/64-bit for different build targets).
Thanks in advance.