I have a C# project that needs to compile as either x86, or x64, and reference different native assemblies depending on the architecture. I realize I could include them both and assign different alias’s and in each file use a #if statement, but this is quite cumbersome.
Is there any way to change a project’s dependencies based on a Compiler condition?
The easiest way is to leverage build configurations. You need to do a bit of manual MSBuild (.csproj) file editing, but it works really nice:
This Link Has a great example of how to go about this.