Target platform/processor at compile time

后端 未结 3 2021
鱼传尺愫
鱼传尺愫 2021-01-12 06:40

Is there a #define in C# that allows me to know, at compile time, if I\'m compiling for x86 (Win32) or x64 (Win64)?

3条回答
  •  臣服心动
    2021-01-12 07:04

    As far as I know Visual Studio defines only DEBUG and TRACE constants. Instead of declaring such constant manually in the project configurations you could use NANT to build your project. It can determine the build platform at compile time and define a custom directive accordingly.

提交回复
热议问题