Dirk Dastardly Dirk Dastardly - 10 days ago 10
C# Question

Managed C++ and AnyCPU

I have a Managed C++ dll that I am referencing from a C# project. The C# project will be compiled as AnyCPU. Is there any way to compile a 32-bit and 64-bit version of the Managed C++ dll and then tell the C# project at runtime to load the correct one depending on which architecture it is being run?

Answer

This article discusses a complex way to do it, and see Stefan's comment that discusses a much simpler methods that applies to some applications.

Comments