What are the differences between Trace and Debug?

Answer Posted / vinod reddy

Trace and Debug - There are two main classes that deal with
tracing - Debug and Trace. They both 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. Typically this means that you
should use System.Diagnostics.Trace.WriteLine for tracing
that you want to work in debug and release builds, and
System.Diagnostics.Debug.WriteLine for tracing that you want
to work only in debug builds.

Tracing is actually the process of collecting information
about the program's execution. Debugging is the process of
finding & fixing errors in our program. Tracing is the
ability of an application to generate information about its
own execution. The idea is that subsequent analysis of this
information may help us understand why a part of the
application is not behaving as it should and allow
identification of the source of the error.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is it preferred to not use finalize for clean up?

565


What is preprocessor in .net? Where it use?

536


How to find last error which occurred?

544


What is viewstate? What does the “enableviewstate” property do?

526


What is virtual directory in asp.net?

520






What is the difference between viewstate and hidden field in asp.net?

492


Is asp.net and .net are same or different?

530


Is it possible to develop a single web application using ASP.NET webforms and ASP.MVC?

604


What are all the various Estimation Techniques available ?

661


What is session state server?

623


How to bind all the binding controls in a page at once in ASP.NET?

533


What are session state modes in asp.net?

554


What is http request and response?

540


What is enableviewstatemac in asp net?

601


In Data grid the question is below quantity price total these are 3 fields available in data grid if you enter quantity the total has to update automatically.Price field is already filled completely

1551