What?s the difference between the Debug class and Trace
class?

Answer Posted / vinay panchal

There are two Trace classes in the Microsoft .NET Framework
library: System.Diagnostics.Trace and
System.Web.TraceContext. These Trace classes are frequently
confused with each other. However, each one is used for a
specific purpose.

You typically use the System.Diagnostics.Trace class to
debug console applications or Windows Forms applications.
You use System.Web.TraceContext only in Microsoft ASP.NET
applications. To display Trace.Write statements on an
ASP.NET page from a Class Library, you must use the
System.Web namespace. The following examples describe how to
use Trace.Write from a Class Library in an ASP.NET application.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between const and readonly in c#.net?

693


What is the base class from which all value types are derived?

715


What does executescalar return in c#?

633


What is the base class in .net from which all the classes are derived from?

711


How can you use abstract class and interface?

734


What is the .NET collection class that allows an element to be accessed using a unique key?

827


How we can create an array with non-default values?

715


What are verbatim strings in c#?

675


Explain synchronous and asynchronous operations?

733


How does dependency injection work c#?

681


What is the difference between func and action delegate?

689


Why would you use untrusted verification?

708


What is selector c#?

671


Is null c# operator?

729


What is a virtual property. Give an example?

702