Why could we debug our application in Release Mode?
-------------
Thanks in Advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Jan 2, 2012, 4:56 AM
Do you mean to say "why would we" (asking what would be the value) or "how could we" (asking what could be done to do it). Those are very different questions. I think that Jaganathan is explaining why and Vulpes is explaining how. I will provide my answer but I first want to know what the question is.
VulpesPosted Jan 2, 2012, 4:41 AM
http://msdn.microsoft.com/en-us/library/system.diagnostics.trace.aspx
The methods of the Trace class (Assert, WriteIf, WriteLine etc) only work if the TRACE pre-processor symbol is defined. In Visual Studio, this symbol is defined by default in both debug and release builds. If the TRACE is symbol is not defined, then the compiler simply removes any calls to Trace class methods or properties.
Jaganathan BantheswaranPosted Jan 2, 2012, 1:29 AM
there are no guarantees that debug mode code works in release mode.
Please read this for more clarification...