ASP.NET Debug and Trace


ASP.NET tracing facilities provide a simple method for seeing the structure and performance characteristics of a page. Additionally, it can be leveraged easily to output custom debug information. Understanding the generated code for a page can be key to tracking down unexpected behavior in custom code.

  • Use the trace From Last column data to quickly narrow down long- running pieces of code. This is particularly useful in isolating performance issues.

  • You can distinguish between inbound and outbound cookie values by looking at the Cookie row in the Headers collection. The value from the Cookie header is the value sent by the client.

  • Implement an Application_OnError handler that traces error information so that if you encounter unusual behavior in an application, you are prepared to gather more information by simply enabling trace.

  • To quickly get to the source code for a page, you do not need to access the Temporary ASP.NET Files directories. Instead, introduce a deliberate syntax error. ASP.NET will flag the error and provide the Show Complete Compilation Source option as well as the compiler output.

  • Do not use ASP.NET debug functionality on a production server. The performance implications are severe. Instead, to gather run time information programmatically, use trace functionality or classes in the System.Diagnostics.Trace namespace.




Microsoft ASP. NET Coding Strategies with the Microsoft ASP. NET Team
Microsoft ASP.NET Coding Strategies with the Microsoft ASP.NET Team (Pro-Developer)
ISBN: 073561900X
EAN: 2147483647
Year: 2005
Pages: 144

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