VS2013 - 针对一些配置的特定操作

时间:2015-07-28 09:44:33

标签: c# visual-studio debugging build

这是我之前提出的一个问题,可以解释我在寻找什么:

The question with help you understand the problem is here

什么会更好?

#if (!DEBUG || !DEBUG1 || !DEBUG2 || !DEBUG3) 
variable=5; #endif

or

if( !System.Diagnostics.Debugger.IsAttached )
{
  //code which should only run if not being debugged
}

如果我想将此特定操作附加到我的4个配置中,我应该使用第一个选项还是第二个选项也是好的,因为System.Diagnostics.Debugger.IsAttached将适合我的每个配置?

0 个答案:

没有答案
相关问题