【发布时间】:2011-01-07 10:15:13
【问题描述】:
在解决方案属性中,我将配置设置为我唯一的项目的“发布”。
在主程序的开头,我有这段代码,它显示“Mode=Debug”。 我在最顶部也有这两行:
#define DEBUG
#define RELEASE
我是否在测试正确的变量?
#if (DEBUG)
Console.WriteLine("Mode=Debug");
#elif (RELEASE)
Console.WriteLine("Mode=Release");
#endif
我的目标是根据调试和发布模式为变量设置不同的默认值。
【问题讨论】:
-
您正在定义调试和发布。
标签: c# debugging release compiler-directives