What is difference between Trace and Debug?

 Posted by Raja on 4/12/2008 | Category: ASP.NET Interview questions | Views: 31078

Use Debug class to debug builds
Use Trace class for both debug and release builds.

Asked In: Many interviews | Alert Moderator 

Comments or Responses

Posted by: Sampath041 on: 3/30/2009
The system.Diagnostics namespace contains the Debug and
Trace classes that include shared methods.

The diffetrnce between these two classes is in the way
Trace and Debug statements are treated at the of creating a
release bulid.

Trace statements are included by default when the program
is compiled in to release build,where as debug statements
are not.The Debug class is used for debugging,however, the
Trace class is used for testing and optimization even after
an application is compiled and released.

Login to post response