Sam*_*mbo 30 c# debugging programming-languages
我想根据我是否在调试模式下构建来有条件地排除/包含代码.
我可以像在C++中一样使用像#ifndef _DEBUG这样简单的东西吗?
Dav*_*kle 51
#if DEBUG
Console.WriteLine("Debug version");
#endif
#if !DEBUG
Console.WriteLine("NOT Debug version");
#endif
Run Code Online (Sandbox Code Playgroud)
看到这个.