"Any CPU" build for C++/CLI

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top