Professional Documents
Culture Documents
Developing Web Applications Using Microsoft Visual Studio 2008
Developing Web Applications Using Microsoft Visual Studio 2008
Applications Using
Microsoft® Visual
Studio® 2008
Module 5: Tracing in Microsoft ASP.NET
Web Applications
• Tracing and the Trace Object
• Remote Debugging
Lesson: Tracing and the Trace Object
• Run Time Information
• Enabling Tracing
• Application-Level Trace
If Trace.IsEnabled Then
message = "Tracing is enabled!"
Trace.Write("myTrace", message)
End If
if (Trace.IsEnabled)
{
message = "Tracing is enabled!";
Trace.Write("myTrace", message);
}
• Changing state of trace dynamically
Trace.IsEnabled = False
Viewing Trace Results
Application-Level Trace
• Application-level tracing
Tracing into a Component
• Import the System.Web library
• Enable tracing
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");
Lesson: Remote Debugging
• Remote Debugging Overview
Logon information
Master Page
Logon Page benefitsMaster.master
login.aspx
Benefits Lab Web
Home Page Application
ASPState
Default.aspx Page Header
header.ascx
Menu Component
Registration Benefits.cs or Benefits.vb
register.aspx TempDB
Web.
config
Prospectus
prospectus.aspx Doctors User Control XML Web
LINQ to SQL doctors.aspx nameDate.ascx Service
Classes DentalService1.asmx
Doctors.dbml
Doctors Dentists
XML Files
Lab Review
Review Questions
• What steps are required to view tracing output on a
specific page?
• What steps are required to enable application-level
tracing?
• What code is required to explicitly turn on tracing in a
component?
Module Review and Takeaways
• Review Questions
• Best Practices
• Tools