有没有办法添加一个预处理器指令来比较编译器使用的C#版本?public T MyMethod<T>()#if CS_7
return default; // Feature 'default literal' is not available in C#null; // Ignore the fact that this won't work, it isn't the point
我想添加一些C#“仅调试”代码,这些代码只在调试人员请求时运行。在C++中,我曾经做过类似以下的事情:{ // of the session until they set it to false. #endif}
我不能在C#中做完全相同的事情,因为没有本地统计。Question:在C#中实现这一目标的最佳方法是