How to define a constant globally in C# (like DEBUG)

前端 未结 4 806
野性不改
野性不改 2020-12-18 20:13

I want to compile a project differently, according to a constant defined by #define, like this:

#define USE_COMPONENT_X

#if USE_COMPONENT_X
...

#endif
         


        
4条回答
  •  南方客
    南方客 (楼主)
    2020-12-18 20:58

    Set it in your IDE or use the the compiler command line switch i.e. -define for Mono.

提交回复
热议问题