Difference between Trace and Debug

This blog shows the difference between Trace and Debug

Trace and Debug work in a similar way, the difference is that tracing from the Debug class only works in builds that have the DEBUG symbol defined, whereas tracing from the Trace class only works in builds that have the TRACE symbol defined.

·         Use System.Diagnostics.Trace.WriteLine for tracing that you want to work in debug and release builds

·         Use System.Diagnostics.Debug.WriteLine for tracing that you want to work only in debug builds.


Ebook Download
View all
Learn
View all