Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Search Your Question

Tuesday, May 6, 2008

What Tracing and debugging facility are given in .Net?

In the System.Diagnostics namespace. There are two main classes that deal with tracing - Debug and Trace. They both work similarly- 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 we should use System.Diagnostics.Trace.WriteLine for tracing that we want to work in debug and release builds, and System.Diagnostics.Debug.WriteLine for tracing that we want to work only in debug builds.

we can trace the execution of an ASP.NET page by using the trace attribute of the page directive. To enable tracing for a single ASP.NET page, include the following directive at the top of the page:

<%@ Page Trace="True" %>

No comments:

Archives