3
Answers

What is difference between debug and trace in C#?

Rajesh Singh

Rajesh Singh

9y
340
1
What is difference between debug and trace in C#?
Answers (3)
0
Krishna Rajput Singh

Krishna Rajput Singh

NA 5.5k 2m 9y
below link helpful..:)
 
http://www.dotnet-guide.com/what-is-the-difference-between-trace-and-debug-in-dot-net.html 
0
Francis

Francis

NA 11.7k 723.7k 9y
Did you meant the classes available in C#. If so, as per MSDN:
 
Debug class:
 Provides a set of methods and properties that help debug your code.
 
Trace class:
Provides a set of methods and properties that help you trace the execution of your code.
 
 Hope this helps!
0
Rajeesh Menoth

Rajeesh Menoth

NA 24.7k 628.6k 9y
Hi,
 
 

Debug

  1. It uses Debug class.
  2. It uses in debug build.
  3. It uses the time of application development.
  4. In Debug mode compiler inserts some debugging code inside the executable.
  5. Debug class works only in debug mode.
  6. Performance analysis cannot be done using Debug.
  7. Debugging uses to find error in program.
  8. For Debug we can use Debug.Write() method.
  9. Debug runs in same thread as main program execute.

Trace

  1. It uses Trace class.
  2. Trace statement includes by default when program compiled into released build.
  3. Trace class is used for testing and optimization even after an application is compiled and released.
  4. Trace class works in both case Debug mode as well as release mode.
  5. Trace runs in different thread form main program execute thread.
  6. For Trace we can use Trace.Write() method.
  7. It uses time of application deployment.