"Any CPU" build for C++/CLI

  • Thread starter Thread starter Dirk
  • Start date Start date
D

Dirk

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
 
Back
Top