.NET Application using a native DLL (build management)
- by moogs
I have a .NET app that is dependent on a native DLL. I have the .NET app set as AnyCPU.
In the post-build step, I plan to copy the correct native DLL from some directory (x86 or AMD64) and place it in the target path.
However, this doesn't work. On a 64-bit machine, the environment variable PROCESSOR_ARCHITECTURE is "x86" in Visual Studio.
My alternative right now is to create a small tool that outputs the processor architecture. This will be used by the post-build step.
Is there a better alternative?
(Side Note: when deploying/packaging the app, the right native DLL is copied to the right platform. But this means we have two separate release folders for x86 and AMD64, which is OK since this is for a device driver. The app is a utility tool for the driver).