Trace vs Debug in .NET BCL

后端 未结 7 1291
余生分开走
余生分开走 2020-12-02 11:58

It seems that the

  • System.Diagnostics.Debug, and
  • System.Diagnostics.Trace

are largely the same, with the notable exception that

7条回答
  •  萌比男神i
    2020-12-02 12:39

    The only difference between trace and debug is that trace statements are included by default in the program when it is compiled into a release build, whereas debug statement are not.

    Thus, the debug class is principally used for debugging in the development phase, while trace can be used for testing and optimization after the application is compiled and released.

提交回复
热议问题