Hello
Can I create a C++/CLI assembly with /clr:pure that is platform agnostic? C#
projects use "Any CPU" as the default platform and the output can be loaded
into a 32-bit or 64-bit process.
I have a VS solution with a C++/CLI dll and a C# exe which uses this dll.
When the exe runs on Windows x64 the C++ dll must be built with x64 as the
target platform. If Win32 is used a BadImageFormatException is thrown. I
tried to modify the Win32 version with CorFlags.exe /32BIT-. This time I do
not get a BadImageFormatException but the Module constructor throws a
FileNotFoundException because msvcm80.dll cannot be found.
Thanks
Jochen Kalmbach [MVP] - 11 Jun 2007 10:35 GMT
HI Dirk!
> Can I create a C++/CLI assembly with /clr:pure that is platform
> agnostic? C# projects use "Any CPU" as the default platform and the
> output can be loaded into a 32-bit or 64-bit process.
You must compile with /clr:safe to support 32 and 64-Bit with one assembly.
See also:
http://msdn2.microsoft.com/en-us/library/31zwwc39
Greetings
Jochen