How to use #if to decide which platform is being compiled for in C#
You can add any constants you want to the .csproj
file. These can be put into conditional property groups like the one below.
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<DefineConstants>TRACE;X64</DefineConstants>
...
</PropertyGroup>
For my Release x64 build, I have defined a X64 constant that I can use like this:
#if X64
#endif