Is there built-in support for tracing/logging

Answer Posted / kirti

Yes, in the System.Diagnostics namespace. 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.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are ajax helpers in asp.net mvc?

597


When using razor views, do you have to take any special steps to protect your asp.net mvc application from cross site scripting (xss) attacks?

708


How we can call a javascript function on the change of a dropdown list in mvc?

576


Explain dependency resolution?

624


Asp.net mvc application, makes use of settings at 2 places for routing to work correctly. What are these 2 places?

630






Can I remove .net framework?

552


Where are the routing rules defined in an asp.net mvc application?

546


How route table is created in ASP.NET MVC?

601


Mention some action filters which are used regularly in ASP.Net MVC?

548


what is model first approach?

609


What are differences between entity framework and l2s? : Entity framework

652


What is Separation of Concerns in ASP.NET ASP.Net MVC?

605


Which version of .net framework is installed?

496


what is entityclient?

688


What is entitytypes? : Entity framework

616