<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Blog of Travis Gneiting &#187; Debugging</title>
	<atom:link href="http://www.blog.travisgneiting.com/category/software-engineering/asp_net/debugging/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blog.travisgneiting.com</link>
	<description></description>
	<lastBuildDate>Mon, 30 Jan 2012 03:45:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	
	
	<!-- google ad injected by adsense-optimizer http://www.adsenseoptimizer.de -->
	<div  style="padding:7px; float: right; padding-right: 0; margin: 3px;"><!-- Ad number: 1 --><script type="text/javascript"><!--
    	 
    	google_ad_client = "pub-3961093531196233"; google_alternate_color = "FFFFFF";
		google_ad_width = 250; google_ad_height = 250;
		google_ad_format = "250x250_as"; google_ad_type = "text_image";
		google_ad_channel ="1685894941"; google_color_border = "336699";
		google_color_link = "0000FF"; google_color_bg = "FFFFFF";
		google_color_text = "000000"; google_color_url = "008000";
		google_ui_features = "rc:0"; //--></script>
		<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>	<item>
		<title>ASP.NET Page and Application Tracing</title>
		<link>http://www.blog.travisgneiting.com/2008/04/17/aspnet-page-and-application-tracing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=aspnet-page-and-application-tracing</link>
		<comments>http://www.blog.travisgneiting.com/2008/04/17/aspnet-page-and-application-tracing/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 13:30:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Trace Debug ASP.NET]]></category>

		<guid isPermaLink="false">http://www.blog.travisgneiting.com/?p=4</guid>
		<description><![CDATA[Tracing The tracing feature in ASP.NET is useful in tracking the execution of an application. This is helpful to display the trace in a way that doesn&#8217;t affect the programs output. To enable tracing on a page-by-page level, set the Page directive in any ASP.NET page to True: &#60;%@ Page Language=&#8221;C#&#8221; Trace=&#8221;true&#8221; TraceMode = &#8220;SortByCategory&#8221; [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><p><!--[if gte mso 9]><xml> Normal   0               false   false   false      EN-US   X-NONE   X-NONE                                                     MicrosoftInternetExplorer4 </xml><![endif]--><!--[if gte mso 9]><xml> </xml><![endif]--> <!--[if gte mso 10]></p>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-qformat:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin:0in;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Verdana","sans-serif";}
</style>
<p><![endif]--></p>
<p><strong>Tracing</strong></p>
<p>The tracing feature in ASP.NET is useful in tracking the execution of an application.  This is helpful to display the trace in a way that doesn&#8217;t affect the programs output.</p>
<p>To enable tracing on a page-by-page level, set the Page directive in any ASP.NET page to True:</p>
<p>&lt;%@ Page Language=&#8221;C#&#8221; Trace=&#8221;true&#8221; TraceMode = &#8220;SortByCategory&#8221; Inherits  = &#8220;System.Web.UI.Page&#8221; CodeFile=&#8221;Default.aspx.cs&#8221; %&gt;</p>
<p>To enable tracing for an entire application add tracing settings to the web.config:</p>
<p>&lt;configuration&gt;<br />
&lt;appSettings/&gt;<br />
&lt;connectionStrings/&gt;<br />
&lt;system.web&gt;<br />
&lt;compilation debug=&#8221;false&#8221; /&gt;<br />
&lt;authentication mode=&#8221;Windows&#8221; /&gt;<br />
&lt;trace enabled =&#8221;true&#8221; pageOutput =&#8221;True&#8221; requestLimit =&#8221;20&#8243; traceMode =&#8221;SortByTime &#8221; /&gt;<br />
&lt;/system.web&gt;<br />
&lt;/configuration&gt;</p>
<p>The page-level setting will take precedence over the web.config setting.</p>
<p><strong>How to view Trace Data.</strong></p>
<p>In the Page_Load event call System.Diagnostics.Trace.Write(). Make sure the pageOutput=True in the webConfig.</p>
<p><strong>What&#8217;s being displayed</strong></p>
<p>1. Request Details<br />
ASP.NET Session ID, Character encoding of the request.</p>
<p>2. Trace information<br />
All Trace.write methods called in the HTTP request. This is helpful to find methods that are taking a long time to execute.</p>
<p>3. Control Tree<br />
HTML of ASP.NET Control Tree.</p>
<p>4. Session State<br />
List all keys and values for users session .</p>
<p>5. Application State<br />
List all keys and values for application.</p>
<p>6. Request Cookies Collection<br />
List all cookies passed in during page request.</p>
<p>7. Response Cookies Collection<br />
List all cookies passed back during page response.</p>
<p>8. Headers Collection<br />
Shows all headers passed in during request from browser.</p>
<p>9. Response Headers Collection<br />
Shows all headers passed back during response.</p>
<p>10. Form Collection<br />
Displays dump of Form Collection and all keys and values.</p>
<p>11. Querystring Collection<br />
Displays dump of Querystring collection and all keys and values.</p>
<p>12. Server Variables<br />
Displays dump of Server Variables with keys and values.</p>
<p><strong>The Trace.axd</strong><br />
Page output only displays information of the current page. If you want to create a collection use Trace.axd.</p>
<p><a href="http://localhost/application-name/trace.axd">http://localhost/application-name/trace.axd</a></p>
<p>Trace.axd will display all tracing data up to the present limit.</p>
<p><strong>Trace Forwarding</strong></p>
<p>ASP.NET allows to forward trace message to System.Diagnostics.Trace:write to DiagnosticsTrace</p>
<p>&lt;trace enabled =&#8221;true&#8221; requestLimit =&#8221;20&#8243; writeToDiagnosticsTrace =&#8221;true &#8221; pageOutput =&#8221;true&#8221;/&gt;</p>
<!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://www.blog.travisgneiting.com/2008/04/17/aspnet-page-and-application-tracing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

