difference between Trace and Debug ?

Answers were Sorted based on User's Feedback



difference between Trace and Debug ?..

Answer / kaushik

According to Microsoft Documentation there is not much
difference between Trace and Debug Class.

Debug only works in debug mode and trace works in debug and
release both mode.

Is This Answer Correct ?    65 Yes 9 No

difference between Trace and Debug ?..

Answer / leela mohan

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.

Is This Answer Correct ?    33 Yes 8 No

difference between Trace and Debug ?..

Answer / swapana thorat

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.

We shall look at two different ways of implementing tracing
in .NET via the System.Web.TraceContext class via the
System.Diagnostics.Trace and System.Diagnostics.Debug
classes. Tracing can be thought of as a better alternative
to the response.writes we used to put in our classic ASP3.0
code to help debug pages.

If we set the Tracing attribute of the Page Directive to
True, then Tracing is enabled. The output is appended in the
web form output. Messeges can be displayed in the Trace
output using Trace.Warn & Trace.Write.

NOTE The only difference between Trace.Warn & Trace.Write is
that the former has output in red color. If the trace is
false, there is another way to enable tracing. This is done
through the application level. We can use the web.config
file and set the trace attribute to true. Here we can set
<trace enabled=false .../>

Note that the Page Directive Trace attribute has precedence
over th application level trace attribute of web.config.
While using application level tracing, we can view the trace
output in the trace.axd file of the project.

Is This Answer Correct ?    13 Yes 0 No

difference between Trace and Debug ?..

Answer / dipti

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.

Is This Answer Correct ?    5 Yes 0 No

difference between Trace and Debug ?..

Answer / rameez.s

Debug Class provides a set of methods and properties that
help debug your code. If you use methods in the Debug class
to print debugging information and check your logic with
assertions, you can make your code more robust without
impacting the performance and code size of your shipping
product. In Visual Studio 2005 projects, creating a debug
build enables Debug.


You can use the properties and methods in the Trace class to
instrument release builds. Instrumentation allows you to
monitor the health of your application running in real-life
settings. Tracing helps you isolate problems and fix them
without disturbing a running system.
In Visual Studio 2005 projects, Trace is enabled by default
for both release and debug builds, so code is generated for
all trace methods in both release and debug builds.
Therefore, you can use Trace to instrument release builds.

Is This Answer Correct ?    6 Yes 4 No

difference between Trace and Debug ?..

Answer / mickey

Debug only works in debug mode and Trace works in debug and
release both mode.

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.

Is This Answer Correct ?    2 Yes 0 No

difference between Trace and Debug ?..

Answer / satendra kumar kasana

Debug only works in debug mode and trace works in debug and
release both mode

Is This Answer Correct ?    3 Yes 2 No

difference between Trace and Debug ?..

Answer / chauhan rakesh botad

Trace and Debug classes :

Fortunately, you do not have to step through an application
line by line to figure out what is happening.

The Systems.Diagnostics namespace includes Trace and Debug
classes.

These two classes (which are essentially identical) include
a number of static methods that can be used to cause your
code to gather information about code-execution paths, code
coverage, and even performance profiling. Both classes also
provide an Assert method that checks for a condition and
displays a message if the condition is false.

Tracing : Tracing is actually the process of collecting
information about the program's execution.

Debug : Debugging is the process of finding & fixing errors
in our program.

Is This Answer Correct ?    1 Yes 2 No

difference between Trace and Debug ?..

Answer / srinivas

Debug only works in debug mode and trace works in debug and
release both mode.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More ASP.NET Interview Questions

How does asp.net work?

0 Answers  


Can we use the java script code in .Net Code behind?

5 Answers   eXensys,


How many object in c# asp .net

1 Answers  


What are session state modes in asp.net?

0 Answers  


How do you enable tracing? a) Set the Trace property of the Web Form to True b) Set the Trace property of the server object to True c) Set the Session variables Trace to True d) Set the Applications Variable Trace to True.

2 Answers   Syntax Softtech,






What are the advantages and disadvantages of session?

0 Answers  


how to create textboxes dynamically and insert textbox text into sql database

2 Answers   AGiSAC,


How to rename a table using sql queries?

0 Answers  


Clearly Explain the ispostback

6 Answers   TCS,


What are the main differences between asp and asp.net?

0 Answers  


What is an il?

0 Answers  


what is SAP fullform

161 Answers   A3Logics, Amazon, DFD, Federal Mogul, Hol Info, IBM, Infosys, Jai Ganesh, Kesri Metal, Lupin, Microsoft, RPG, SAP Labs, SRS Group, TCS, Videocon,


Categories