Debug.WriteLine in release build

后端 未结 4 1194
[愿得一人]
[愿得一人] 2020-12-13 17:15

Is there a way to use Debug.WriteLine in a release build without defining DEBUG?

4条回答
  •  醉话见心
    2020-12-13 17:25

    No. If you don't define the DEBUG preprocessor symbol, any calls to Debug.* will be removed by the compiler due to the [Conditional("DEBUG")] attribute being applied.

    You might want to consider Trace.WriteLine or other logging techniques though.

提交回复
热议问题