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

Explain the difference between private and shared assembly?

554


Name the control which cannot be placed in mdi?

567


Does c# have functions?

555


What is public void in c#?

597


What are the types of class in c#?

597






What is a method signature?

620


Why to use lock statement in c#?

577


What is the interface in c#?

608


What is a c# delegate?

698


Explain deadlock?

597


Why do I get a security exception when I try to run my c# app?

637


What is parameters in c#?

587


What is private readonly in c#?

618


From which base class do all Web Forms inherit from?

602


How to implement a singleton design pattern in c#?

565