Chapter 14 Quick Reference


To

Do this

Enable page-level tracing

Add the Trace attribute to the @ Page directive and set its value to True.

Enable application-level tracing

Add the <trace> configuration section to Web.config with the desired attributes. At a minimum, the enabled attribute is required and should be set to True.

Write to the trace output

Call either the Trace.Write or Trace.Warn method, passing the appropriate arguments.

View detailed error information or prepare for using the runtime debugger

Compile your page or pages in Debug mode by either adding the Debug attribute to the @ Page directive with a value of True or adding the <compilation> section to the Web.config file and setting its debug attribute to True.

Invoke the runtime debugger

Locate the file DbgCLR.exe and execute it.

Debug a page using the Visual Studio .NET debugger

Ensure that the page is set to compile in debug mode, which is the default in Visual Studio .NET. Set breakpoints by clicking on the gray bar on the left side of the code window.

Make a breakpoint conditional

Set a breakpoint as described earlier in the chapter, and then right-click on the line and select Breakpoint Properties from the context menu. Set a condition (to break only when a condition is met) or a hit count (to break only after some number of passes through the line where the breakpoint is).

To disable debugging when moving an application to production

In Web.Config, in the <compilation> tag, set debug to False. In the Build menu, select Configuration, change the configuration for the project involved to Release, and then rebuild the application.




Microsoft ASP. NET Programming with Microsoft Visual Basic. NET Version 2003 Step by Step
Microsoft ASP.NET Programming with Microsoft Visual Basic .NET Version 2003 Step By Step
ISBN: 0735619344
EAN: 2147483647
Year: 2005
Pages: 126

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net