1 / 14

Module 6: Tracing in Microsoft ASP.NET Web Applications

Module 6: Tracing in Microsoft ASP.NET Web Applications. Overview. Understanding Tracing Remote Debugging. Understanding Tracing. Runtime Information Enabling Tracing Using the Trace Object Viewing Trace Results Using Application-Level Trace

lundy
Download Presentation

Module 6: Tracing in Microsoft ASP.NET Web Applications

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Module 6:Tracing in Microsoft ASP.NET Web Applications

  2. Overview • Understanding Tracing • Remote Debugging

  3. Understanding Tracing • Runtime Information • Enabling Tracing • Using the Trace Object • Viewing Trace Results • Using Application-Level Trace • Demonstration: Tracing Through a Web Application • Tracing into a Component

  4. Runtime Information • During runtime, you can: • Output values of variables • Assert whether a condition is met • Trace through the execution path of the application • You can collect runtime information using: • The Trace object • The Debug object

  5. Enabling Tracing • Page-level tracing displays trace statements only on the configured page • Enabling page-level tracing • Application-level tracing displays trace information for all pages in a Web application • Enabling application-level tracing in the Web.config file • Practice: Check default settings <%@ Page Language="vb" Trace="true" %> <%@ Page Language="c#" Trace="true" %> <trace enabled="true" pageOutput="true" localOnly="true"/>

  6. Using the Trace Object • Inserting trace messages • Conditional execution with Trace.IsEnabled • Dynamically change state of trace Trace.Write ("category", "message") Trace.Warn ("category", "message") If Trace.IsEnabled Then strMsg = "Tracing is enabled!" Trace.Write("myTrace", strMsg) End If if (Trace.IsEnabled) { strMsg = "Tracing is enabled!"; Trace.Write("myTrace", strMsg); } Trace.IsEnabled = False

  7. Viewing Trace Results

  8. Page Application Result Trace=True Trace=True or Trace=False • Trace results are displayed on page Trace=False Trace=True or Trace=False • Trace results are not displayed Trace not set Trace=True • Trace results are displayed on page Using Application-Level Trace • Application-level trace statements are displayed on individual pages • Set pageOutput=false in the Web.config file and trace results are viewable by trace viewer http://server/project/trace.axd

  9. Demonstration: Tracing Through a Web Application • Page-level tracing • Application-level tracing

  10. Tracing into a Component • Import the System.Web Library • Enable Tracing • Call Trace methods Imports System.Web using System.Web; HttpContext.Current.Trace.IsEnabled = True HttpContext.Current.Trace.IsEnabled = true; HttpContext.Current.Trace.Write _ ("component", "this is my trace statement") HttpContext.Current.Trace.Write ("component", "this is my trace statement");

  11. Lesson: Remote Debugging • How to Perform Remote Debugging

  12. How to Perform Remote Debugging • Remote debugging: • Debug Web applications remotely • Simplifies team development • Simplifies Web site management • Requirements for remote debugging: • Requires Visual Studio .NET or remote components on the server • Visual Studio .NET must be installed on the client • Requires administrative access to the server • Requires access for the user who is performing debugging

  13. Review • Understanding Tracing • Remote Debugging

  14. Lab 6: Tracing in Microsoft ASP.NET Web Applications Logon Page Login.aspx BenefitsHome PageDefault.aspx CohoWinery Page HeaderHeader.ascx ASPState Menu ComponentClass1.vb or Class1.cs Registration Register.aspx Web.config tempdb Life InsuranceLife.aspx RetirementRetirement.aspx MedicalMedical.aspx DentalDental.aspx XML Web ServicedentalService1.asmx ProspectusProspectus.aspx DoctorsDoctors.aspx User Controlnamedate.ascx Lab Web Application XML Files Doctors Dentists

More Related