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 is entityclient?

677


what do you mean by table-per-hierarchy?

597


What is entity graph? : Entity framework

524


What is viewdata?

583


Can we add constraints to the route? If yes, explain how we can do it?

727






Explain the use of Inversion of control (IOC)?

598


why DotNetFramework is included in building a software

2205


Explain how you can send the result back in JSON format in MVC?

574


Explain what platforms does the .net framework run on?

546


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

621


How do you specify comments using razor syntax?

596


What are advantages of Dependency Injection (DI) in ASP.Net MVC?

570


What are the Core features of ASP.NET MVC?

594


Explain the .net framework.

524


How does .net framework works?

557