<?xml version="1.0" encoding="ISO-8859-1"?>
<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>Egil Hansen &#187; Ukadc.Diagnostics</title>
	<atom:link href="http://egilhansen.com/tag/ukadcdiagnostics/feed/" rel="self" type="application/rss+xml" />
	<link>http://egilhansen.com</link>
	<description>.NET, Windows, ASP.Net, scripts</description>
	<lastBuildDate>Thu, 04 Feb 2010 13:32:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>System.Diagnostics + ASP.Net Web Site &#8211; remember to set compilerOptions=&#8221;/d:TRACE&#8221;</title>
		<link>http://egilhansen.com/2008/06/03/systemdiagnostics-aspnet-website-remember-to-set-compileroptions-d-trace/</link>
		<comments>http://egilhansen.com/2008/06/03/systemdiagnostics-aspnet-website-remember-to-set-compileroptions-d-trace/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 21:18:42 +0000</pubDate>
		<dc:creator>Egil Hansen</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[System.Diagnostics]]></category>
		<category><![CDATA[Ukadc.Diagnostics]]></category>

		<guid isPermaLink="false">http://www.egil.dk/?p=80</guid>
		<description><![CDATA[Today I was looking at Ukadc.Diagnostics, an extension to the System.Diagnostics namespace, and decided to build a test website myself to get more familiar with it. After reading through Ukadc.Diagnostics Reference Example I thought it would be a homerun in the first try, but it turns out that without adding compilerOptions="/d:TRACE" to each compiler in [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was looking at <a href="http://www.codeplex.com/UkadcDiagnostics">Ukadc.Diagnostics</a>, an extension to the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.aspx">System.Diagnostics namespace</a>, and decided to build a test website myself to get more familiar with it. After reading through <a href="http://www.codeplex.com/UkadcDiagnostics/Wiki/View.aspx?title=QuickReferenceExample&amp;referringTitle=Home">Ukadc.Diagnostics Reference Example</a> I thought it would be a homerun in the first try, but it turns out that without adding <code>compilerOptions="/d:TRACE"</code> to each compiler in the compilers section in the Web.config, the tracing code is never compiled into the assemblies at runtime. Needless to say, I was scratching my head since my sample console application worked as expected the first time.</p>
<p>My compilers section ended up looking like this (it is located in the system.codedom section)</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;compilers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;compiler</span> <span style="color: #000066;">language</span>=<span style="color: #ff0000;">&quot;c#;cs;csharp&quot;</span> <span style="color: #000066;">extension</span>=<span style="color: #ff0000;">&quot;.cs&quot;</span> </span>
<span style="color: #009900;">            <span style="color: #000066;">compilerOptions</span>=<span style="color: #ff0000;">&quot;/d:TRACE&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">warningLevel</span>=<span style="color: #ff0000;">&quot;4&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;providerOption</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;CompilerVersion&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;v3.5&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;providerOption</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;WarnAsError&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/compiler<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;compiler</span> <span style="color: #000066;">language</span>=<span style="color: #ff0000;">&quot;vb;vbs;visualbasic;vbscript&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">compilerOptions</span>=<span style="color: #ff0000;">&quot;/d:Trace=true&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">extension</span>=<span style="color: #ff0000;">&quot;.vb&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000066;">warningLevel</span>=<span style="color: #ff0000;">&quot;4&quot;</span> </span>
<span style="color: #009900;">            <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;providerOption</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;CompilerVersion&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;v3.5&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;providerOption</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;OptionInfer&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;providerOption</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;WarnAsError&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/compiler<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/compilers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Do note that this is not an issue with ASP.Net Web Applications, since they are precompiled. For more on the subject, <a href="http://msdn.microsoft.com/en-us/library/b0ectfxd.aspx">MSDN has a great article</a> which certainly saved me in this instance.</p>
]]></content:encoded>
			<wfw:commentRss>http://egilhansen.com/2008/06/03/systemdiagnostics-aspnet-website-remember-to-set-compileroptions-d-trace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
