What is difference between debug and trace in C#?Rajesh Singh11yAsked Dec 18, 2015, 11:22 PM EST3 answersShareLinkedInXCopy linkSave
What is difference between debug and trace in C#?Rajesh Singh11yAsked Dec 18, 2015, 11:22 PM EST3 answersShareLinkedInXCopy linkSave
Rajeesh MenothRank #118 · 18.4K reputation11y agoPosted Dec 18, 2015, 11:34 PM EST0 Hi, Debug It uses Debug class.It uses in debug build.It uses the time of application development.In Debug mode compiler inserts some debugging code inside the executable.Debug class works only in debug mode.Performance analysis cannot be done using Debug.Debugging uses to find error in program.For Debug we can use Debug.Write() method.Debug runs in same thread as main program execute. Trace It uses Trace class.Trace statement includes by default when program compiled into released build.Trace class is used for testing and optimization even after an application is compiled and released. Trace class works in both case Debug mode as well as release mode.Trace runs in different thread form main program execute thread.For Trace we can use Trace.Write() method. It uses time of application deployment.0Francis SusaimichaelRank #466 · 5.4K reputation11y agoPosted Dec 18, 2015, 11:35 PM EST0Did 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!0Krishna Rajput SinghRank #605 · 4K reputation11y agoPosted Dec 19, 2015, 2:51 AM EST0below link helpful..:) http://www.dotnet-guide.com/what-is-the-difference-between-trace-and-debug-in-dot-net.html 0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign inKnow the answer?Answer a question in the forums and earn +20 SHARP for every answer.See unanswered questionsForumsTop experts01Arun PottiAnswers in the forums20answers02Tahir AnsariAnswers in the forums5answers03Kamlesh KumarAnswers in the forums5answers04Sam HobbsAnswers in the forums4answers05Željko PerićAnswers in the forums3answers?YouYour name goes here.Every answer: 20 SHARP.JoinFull leaderboard →2026DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Francis SusaimichaelRank #466 · 5.4K reputation11y agoPosted Dec 18, 2015, 11:35 PM EST0Did 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
Krishna Rajput SinghRank #605 · 4K reputation11y agoPosted Dec 19, 2015, 2:51 AM EST0below link helpful..:) http://www.dotnet-guide.com/what-is-the-difference-between-trace-and-debug-in-dot-net.html 0
Rajeesh MenothRank #118 · 18.4K reputationPosted Dec 18, 2015, 11:34 PM EST
Debug
Trace
Francis SusaimichaelRank #466 · 5.4K reputationPosted Dec 18, 2015, 11:35 PM EST
Krishna Rajput SinghRank #605 · 4K reputationPosted Dec 19, 2015, 2:51 AM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts