<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Paul Lockwood&#039;s Blog &#187; Development (General)</title>
	<atom:link href="http://dotnetworkaholic.com/category/development-general/feed/" rel="self" type="application/rss+xml" />
	<link>http://dotnetworkaholic.com</link>
	<description>Atlanta based .Net Developer/ Architect</description>
	<lastBuildDate>Fri, 04 May 2012 12:59:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dotnetworkaholic.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Paul Lockwood&#039;s Blog &#187; Development (General)</title>
		<link>http://dotnetworkaholic.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dotnetworkaholic.com/osd.xml" title="Paul Lockwood&#039;s Blog" />
	<atom:link rel='hub' href='http://dotnetworkaholic.com/?pushpress=hub'/>
		<item>
		<title>Filter log4net to a single thread using Notepad++</title>
		<link>http://dotnetworkaholic.com/2011/04/30/filter-log4net-single-thread/</link>
		<comments>http://dotnetworkaholic.com/2011/04/30/filter-log4net-single-thread/#comments</comments>
		<pubDate>Sat, 30 Apr 2011 18:44:53 +0000</pubDate>
		<dc:creator>dotnetworkaholic</dc:creator>
				<category><![CDATA[Development (General)]]></category>
		<category><![CDATA[log4j]]></category>
		<category><![CDATA[log4net]]></category>
		<category><![CDATA[Notepad++]]></category>
		<category><![CDATA[one]]></category>
		<category><![CDATA[single]]></category>
		<category><![CDATA[thread]]></category>

		<guid isPermaLink="false">http://dotnetworkaholic.com/?p=771</guid>
		<description><![CDATA[Over the years I’ve Googled and Googled for a solution to this. Heck I even tried Bing! Finally time + an urgent need permitted figuring out a simple solution. To filter down to one thread using Notepad++: Copy the angle brackets and thread number to clipboard. E.g. “[12]” Menu -&#62; TextFX Viz -&#62; Hide Lines [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=771&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Over the years I’ve Googled and Googled for a solution to this. Heck I even tried Bing! Finally time + an urgent need permitted figuring out a simple solution. To filter down to one thread using Notepad++:</p>
<ul>
<li>Copy the angle brackets and thread number to clipboard. E.g. “[12]”</li>
<li>Menu -&gt; TextFX Viz -&gt; Hide Lines without (Clipboard) text</li>
<li>Press Ctrl-A (Select all text)</li>
<li>Menu -&gt; TextFX Viz -&gt; Delete Invisible Selection</li>
<li>Press Ctrl-A (Select all text)</li>
<li>Menu -&gt; TextFX Edit -&gt; Delete Blank Lines</li>
<li>That’s it! You are now viewing one logging from only one Thread</li>
</ul>
<p><strong>This works very quickly even with 70,000+ line 10MByte log files. </strong>IMO it avoids the need for xml log4net logging and Chainsaw (or similar).Simpler is always better.</p>
<p>Demo: Two threads counting to 100:</p>
<p><a href="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-1.png"><img class="aligncenter size-full" title="log4net_single_thread (1)" src="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-1.png?w=614" alt="" /></a></p>
<p>Copy the angle brackets and thread number to clipboard. E.g. “[12]”</p>
<p>Menu -&gt; TextFX Viz -&gt; Hide Lines without (Clipboard) text</p>
<p><a href="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-2.png"><img class="aligncenter size-full" title="log4net_single_thread (2)" src="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-2.png?w=614" alt="" /></a></p>
<p>Press Ctrl-A (Select all text)</p>
<p>Menu -&gt; TextFX Viz -&gt; Delete Invisible Selection</p>
<p><a href="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-3.png"><img class="aligncenter size-full" title="log4net_single_thread (3)" src="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-3.png?w=614" alt="" /></a></p>
<p>Press Ctrl-A (Select all text)</p>
<p>Menu -&gt; TextFX Edit -&gt; Delete Blank Lines</p>
<p><a href="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-4.png"><img class="aligncenter size-full" title="log4net_single_thread (4)" src="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-4.png?w=614" alt="" /></a></p>
<p>That’s it! You are now viewing one logging from only one Thread</p>
<p><a href="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-5.png"><img class="aligncenter size-full" title="log4net_single_thread (5)" src="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-5.png?w=614" alt="" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetworkaholic.wordpress.com/771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetworkaholic.wordpress.com/771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetworkaholic.wordpress.com/771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetworkaholic.wordpress.com/771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetworkaholic.wordpress.com/771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetworkaholic.wordpress.com/771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetworkaholic.wordpress.com/771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetworkaholic.wordpress.com/771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetworkaholic.wordpress.com/771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetworkaholic.wordpress.com/771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetworkaholic.wordpress.com/771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetworkaholic.wordpress.com/771/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetworkaholic.wordpress.com/771/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetworkaholic.wordpress.com/771/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=771&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetworkaholic.com/2011/04/30/filter-log4net-single-thread/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4dc3efce8716699965ae2767d9fa4728?s=96&#38;d=retro&#38;r=G" medium="image">
			<media:title type="html">dotnetworkaholic</media:title>
		</media:content>

		<media:content url="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-1.png" medium="image">
			<media:title type="html">log4net_single_thread (1)</media:title>
		</media:content>

		<media:content url="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-2.png" medium="image">
			<media:title type="html">log4net_single_thread (2)</media:title>
		</media:content>

		<media:content url="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-3.png" medium="image">
			<media:title type="html">log4net_single_thread (3)</media:title>
		</media:content>

		<media:content url="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-4.png" medium="image">
			<media:title type="html">log4net_single_thread (4)</media:title>
		</media:content>

		<media:content url="http://dotnetworkaholic.files.wordpress.com/2011/04/log4net_single_thread-5.png" medium="image">
			<media:title type="html">log4net_single_thread (5)</media:title>
		</media:content>
	</item>
		<item>
		<title>TeamCity Release Build sgen.exe gotcha</title>
		<link>http://dotnetworkaholic.com/2009/06/17/teamcity-release-build-sgen-exe-gotcha/</link>
		<comments>http://dotnetworkaholic.com/2009/06/17/teamcity-release-build-sgen-exe-gotcha/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 16:42:41 +0000</pubDate>
		<dc:creator>dotnetworkaholic</dc:creator>
				<category><![CDATA[Development (General)]]></category>

		<guid isPermaLink="false">http://dotnetworkaholic.com/?p=337</guid>
		<description><![CDATA[TeamCity is great, I had it up and running with Automated Tests in just minutes. But.. attempting to make a Release Build generated the following error. Googling shows many people have the same error and I only found ugly solutions that required manual registry editing, copying of files etc: c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(2015, 9): error MSB3091: Task failed [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=337&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>TeamCity is great, I had it up and running with Automated Tests in just minutes. But.. attempting to make a Release Build generated the following error. Googling shows many people have the same error and I only found ugly solutions that required manual registry editing, copying of files etc:</p>
<p><span style="color:#ff0000;">c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(2015, 9): error MSB3091: Task failed because &#8220;sgen.exe&#8221; was not found, or the correct Microsoft Windows SDK is not installed. The task is looking for &#8220;sgen.exe&#8221; in the &#8220;bin&#8221; subdirectory beneath the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A. You may be able to solve the problem by doing one of the following: 1) Install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5. 2) Install Visual Studio 2008. 3) Manually set the above registry key to the correct location. 4) Pass the correct location into the &#8220;ToolPath&#8221; parameter of the task.</span></p>
<p>The first thing I did was use msbuild from the command line; sure enough Debug Builds were fine and Release Builds had the same error. This ruled out Team City. Obviously installing VS2008 on our build box would solve the issue, but I assumed the build tools must available elsewhere without need all of VS2008. They are:</p>
<p><strong>The solution is</strong>: Download the Windows SDK and install .Net Development Tools (it says 2008 Server but I did this on XP SP3):<br />
<a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc">http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc</a></p>
<p><img class="aligncenter size-full wp-image-339" title="WindowsSdkForServer2008" src="http://dotnetworkaholic.files.wordpress.com/2009/06/windowssdkforserver20081.png?w=614" alt="WindowsSdkForServer2008"   /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetworkaholic.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetworkaholic.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetworkaholic.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetworkaholic.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetworkaholic.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetworkaholic.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetworkaholic.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetworkaholic.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetworkaholic.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetworkaholic.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetworkaholic.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetworkaholic.wordpress.com/337/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetworkaholic.wordpress.com/337/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetworkaholic.wordpress.com/337/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=337&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetworkaholic.com/2009/06/17/teamcity-release-build-sgen-exe-gotcha/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4dc3efce8716699965ae2767d9fa4728?s=96&#38;d=retro&#38;r=G" medium="image">
			<media:title type="html">dotnetworkaholic</media:title>
		</media:content>

		<media:content url="http://dotnetworkaholic.files.wordpress.com/2009/06/windowssdkforserver20081.png" medium="image">
			<media:title type="html">WindowsSdkForServer2008</media:title>
		</media:content>
	</item>
		<item>
		<title>Reflections on five years NUnit experience</title>
		<link>http://dotnetworkaholic.com/2007/06/19/reflections-of-five-years-nunit-experience/</link>
		<comments>http://dotnetworkaholic.com/2007/06/19/reflections-of-five-years-nunit-experience/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 18:49:21 +0000</pubDate>
		<dc:creator>dotnetworkaholic</dc:creator>
				<category><![CDATA[Development (General)]]></category>

		<guid isPermaLink="false">http://dotnetworkaholic.com/reflections-of-five-years-nunit-experience/</guid>
		<description><![CDATA[It has been five years since I first used NUnit and have used it with great success on almost every project since then. This post briefly reflects the pros and cons of Automated Developer Testing I experienced. . Zero Defects can be the norm Given a serious amount of control on projects I insist on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=128&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It has been five years since I first used NUnit and have used it with great success on almost every project since then. This post briefly reflects the pros and cons of Automated Developer Testing I experienced.</p>
<p><strong>. Zero Defects can be the norm</strong><br />
Given a serious amount of control on projects I insist on ~100% coverage for the most complex pieces. Every time this happened the complex code was delivered with zero (or very close) defects. Admittedly before NUnit I received a lot of praise of stable code and attention to detail, but with with NUnit we can even redesign working code to be <em>more maintainable and still release with almost 100% stable code</em>. Redesigning for maintainability is not practical without a suite of automated tests &#8211; it normally requires a complete rewrite.</p>
<p><strong> . 100% Coverage is for Fools</strong><br />
Sometimes creating Automated Tests make prefect sense, and sometime it costs more time than it saves. I aim for 100% coverage on reusable libraries, critical architecture and anytime I think the business rules are far too complex for QA to completely understand let alone regression test on a regular basis. 100% Coverage on simple data manipulation web page will be a frustrating waste of your time.</p>
<p><strong>. TDD &#8211; Good luck with that! </strong><br />
Unless your company has several years experience writing Automated Tests you will not get buy in for TDD. Learn to walk before you try to run.</p>
<p><strong> . Continuous Integration  is an easier win</strong><br />
I can install a Cruise Control in a day and educate all devs in one 30 minute presentation. Before looking at Automated Developer Tests I highly recommend rolling Continuous Integration our first. It is a <strong>massive win</strong> for very little effort. Managers and developers alike always see the value, this should build up your credibility enough to start an NUnit pilot.</p>
<p><strong>. Screw Mocks, use a real database, ldap etc</strong><br />
Yes Mocks can work, but in my experience I have seen developers waste time coding Mocks, Object Mothers etc. A far simpler approach is to commit to a reasonably large amount of upfront effort so the Automated Tests setup and tear down a real environment. This framework should be created one expert developer and will result in some complex, hard to maintain code, but it then becomes very simple for even junior developers to test <strong>large sections </strong>of their code, not just wimpy Unit Tests.<strong> This is the foremost reason I have had so much success with NUnit</strong>. I have my own framework for SQL Server/ Oracle which took about three re-writes to become as simple and stable as it is today &#8211; you will need great database skills and good C# but once written it just works. Via Cruise Control we automatically  spot problems in build scripts instantly, if anyone changes sproc parameters without updating the DAL we spot that too! I even have a suite of test on one project that does an end-to-end publish mimicking data coming from several internal feeds, being data scrubbed by our system, transformed into records in our system and push out the other end to table ready for user consumption! Probably 100klocs of C# and PL/SQL are executed by a single test &#8211; if anything breaks we know about it very quickly.</p>
<p><strong>. Hundreds of small tests or a few Large Tests?<br />
</strong>A classic mistake I see is developers taking the Unit word too literally and set about writing literally hundreds of test for one module. Although sound in theory, it is madness in practice. These developers run out of time and generally I see a stack of pretty useless tests. You should aim for the most coverage you can per test, of course when such tests break it is not immediately obvious what broke but you will be aletred that something broke, and Cruise Control will show you what code changed since the last build &#8211; making it an easy fix almost every time.  So do you want to spend weeks writing hundreds of tiny tests or a few days writing all-encompassing  tests? In reality no team I have worked on has every has been permitted the time to write hundreds of test. Also most developers don&#8217;t have that kind of patience which is why TDD has a low adoption rate. To clarify this point in general go black box rather than white box &#8211; not I said in general, use your common sense here <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong> . NUnit can really stress developers out</strong><br />
This is a serious problem when developers are under the gun to meet deadlines and an NUnit test breaks the Cruise Control build. Of course everyone knows all work should stop until the build is fixed, but 90% of developers will just mark the test with [Ignore] and work on what their manager is shouting for.</p>
<p><strong> . Some Managers think that is what (cheaper) QA staff is for</strong><br />
No explanation is needed I am sure. Some managers get the SDLC and some do not, and I can offer no solution to this problem. Some managers can only focus on very short-terms goals.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetworkaholic.wordpress.com/128/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetworkaholic.wordpress.com/128/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetworkaholic.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetworkaholic.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetworkaholic.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetworkaholic.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetworkaholic.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetworkaholic.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetworkaholic.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetworkaholic.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetworkaholic.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetworkaholic.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetworkaholic.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetworkaholic.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetworkaholic.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetworkaholic.wordpress.com/128/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=128&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetworkaholic.com/2007/06/19/reflections-of-five-years-nunit-experience/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4dc3efce8716699965ae2767d9fa4728?s=96&#38;d=retro&#38;r=G" medium="image">
			<media:title type="html">dotnetworkaholic</media:title>
		</media:content>
	</item>
		<item>
		<title>Line numbers in your error logs</title>
		<link>http://dotnetworkaholic.com/2005/04/24/release-builds-with-debug-symols-ie-line-numbers-in-your-error-logs/</link>
		<comments>http://dotnetworkaholic.com/2005/04/24/release-builds-with-debug-symols-ie-line-numbers-in-your-error-logs/#comments</comments>
		<pubDate>Mon, 25 Apr 2005 01:49:00 +0000</pubDate>
		<dc:creator>dotnetworkaholic</dc:creator>
				<category><![CDATA[Development (General)]]></category>

		<guid isPermaLink="false">http://dotnetworkaholic.com/release-builds-with-debug-symols-ie-line-numbers-in-your-error-logs/</guid>
		<description><![CDATA[Basic trivia to those with long Microsoft development backgrounds, but I only learned this recently. In a nutshell Release v’s Debug simply enables/disables compilation options. With one minor tweak we can deliver Release Mode builds with Debug Symbols. Compile time and JIT optimization is not affected, but you will get lines numbers in logged stack traced traces. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=76&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Basic trivia to those with long Microsoft development backgrounds, but I only learned this recently. In a nutshell Release v’s Debug simply enables/disables compilation options. With one minor tweak we can deliver Release Mode builds with Debug Symbols. Compile time and JIT optimization is not affected, but you will get lines numbers in logged stack traced traces.</p>
<p>Can anyone tell me why one would NOT always deploy pbd (debug symbols) files with your code other than IP issues? &#8220;Because we hate all developers and it makes Management&#8217;s day watching them debug blind&#8221; is not a valid answer.</p>
<p>Coupled with log4net deploying pdbs really helped me stabilize a nightmare headless process on my last assignment. What is log4net I hear many ask? Attend the first fifteen minutes of my Atlanta Code Camp presentation or read a post or two like this:</p>
<p><a href="http://blogs.acceleration.net/ryan/archive/2004/11/10/380.aspx">http://blogs.acceleration.net/ryan/archive/2004/11/10/380.aspx</a></p>
<p>Do I hear a few voices at the back are saying they love EIF and the MS Application Block? If you are using them already then probably stick with them as they do work, if not scan these posts and make an educated decision:</p>
<p><a href="http://weblogs.asp.net/cazzu/archive/2004/05/17/133196.aspx">http://weblogs.asp.net/cazzu/archive/2004/05/17/133196.aspx</a></p>
<p><a href="http://www.cauldwell.net/patrick/blog/CommentView,guid,13345.aspx">http://www.cauldwell.net/patrick/blog/CommentView,guid,13345.aspx</a></p>
<p><a href="http://dotnetjunkies.com/WebLog/kenbrubaker/archive/2004/10/04/27581.aspx">http://dotnetjunkies.com/WebLog/kenbrubaker/archive/2004/10/04/27581.aspx</a></p>
<p>There are many more posts debating EIF and log4net:</p>
<p><a href="http://www.google.com/search?hl=en&amp;lr=&amp;q=log4net+eif">http://www.google.com/search?hl=en&amp;lr=&amp;q=log4net+eif</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetworkaholic.wordpress.com/76/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetworkaholic.wordpress.com/76/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetworkaholic.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetworkaholic.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetworkaholic.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetworkaholic.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetworkaholic.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetworkaholic.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetworkaholic.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetworkaholic.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetworkaholic.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetworkaholic.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetworkaholic.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetworkaholic.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetworkaholic.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetworkaholic.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=76&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetworkaholic.com/2005/04/24/release-builds-with-debug-symols-ie-line-numbers-in-your-error-logs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4dc3efce8716699965ae2767d9fa4728?s=96&#38;d=retro&#38;r=G" medium="image">
			<media:title type="html">dotnetworkaholic</media:title>
		</media:content>
	</item>
		<item>
		<title>Atlanta&#039;s Java User Group</title>
		<link>http://dotnetworkaholic.com/2004/09/21/atlantas-java-user-group/</link>
		<comments>http://dotnetworkaholic.com/2004/09/21/atlantas-java-user-group/#comments</comments>
		<pubDate>Wed, 22 Sep 2004 01:29:00 +0000</pubDate>
		<dc:creator>dotnetworkaholic</dc:creator>
				<category><![CDATA[Development (General)]]></category>

		<guid isPermaLink="false">http://dotnetworkaholic.com/atlantas-java-user-group/</guid>
		<description><![CDATA[Atlanta’s Java User Group is excellent. Tonight Justin Gehtland talked about his new book Better, Faster, Lighter Java. It was a thoroughly enjoyable evening, even with the numerous (and almost all inaccurate) .Net jibes. Prior to the main event Burr Sutter (who I already knew) led a great discussion with the audience on a raft [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=111&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Atlanta’s Java User Group is excellent. Tonight Justin Gehtland talked about his new book <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0596006764">Better, Faster, Lighter Java</a>. It was a thoroughly enjoyable evening, even with the numerous (and almost all inaccurate) .Net jibes.</p>
<p>Prior to the main event Burr Sutter (who I already knew) led a great discussion with the audience on a raft of subjects. Our .Net groups are missing someone with his panache to work the crowd; he is at least a DCC level speaker.</p>
<p>A fundamental subject of the book is <strong>Why Do Many Java Project Fail?</strong> As a former Java developer I agreed with many of the assertions including:</p>
<p>. Complexity – Java people love buzzwords and apply any they know anywhere!</p>
<p>. Taking things too far – e.g. Layering <em>everything</em></p>
<p>. EJB misuse – Been there personally!</p>
<p>. Peer Pressure to write ‘smart’ code</p>
<p>It was also interesting to see just how fragmented the Java tools/ platform extensions market has become since I booted the JVM out of my career (March 2001). The number of commercial-quality Open Source tools available is amazing. In fact commercial companies are now viewing projects like Hibernate as serious competition. In my view this fragmentation lowers each tool’s user base and hence their quality. Why is the CLR, .Net Framework and VS.Net so stable? Because a massive number of sales means Microsoft can afford serious development and gargantuan testing efforts. Java EJB Servers cost around $100K and are apparently as stable Scott McNealy’s career. Without the effort of a Microsoft style Product Development Lifecycle you just cannot create Microsoft quality products. I would love to yatter on about the evening but no one reads long blog entries, so watch this space for news from future Java meetings.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetworkaholic.wordpress.com/111/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetworkaholic.wordpress.com/111/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetworkaholic.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetworkaholic.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetworkaholic.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetworkaholic.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetworkaholic.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetworkaholic.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetworkaholic.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetworkaholic.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetworkaholic.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetworkaholic.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetworkaholic.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetworkaholic.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetworkaholic.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetworkaholic.wordpress.com/111/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=111&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetworkaholic.com/2004/09/21/atlantas-java-user-group/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4dc3efce8716699965ae2767d9fa4728?s=96&#38;d=retro&#38;r=G" medium="image">
			<media:title type="html">dotnetworkaholic</media:title>
		</media:content>
	</item>
		<item>
		<title>Defensive Programming</title>
		<link>http://dotnetworkaholic.com/2004/09/07/defensive-programming-%e2%80%93-gigo-no-longer-washes/</link>
		<comments>http://dotnetworkaholic.com/2004/09/07/defensive-programming-%e2%80%93-gigo-no-longer-washes/#comments</comments>
		<pubDate>Tue, 07 Sep 2004 20:38:00 +0000</pubDate>
		<dc:creator>dotnetworkaholic</dc:creator>
				<category><![CDATA[Development (General)]]></category>

		<guid isPermaLink="false">http://dotnetworkaholic.com/defensive-programming-%e2%80%93-gigo-no-longer-washes/</guid>
		<description><![CDATA[GIGO, Garbage In, Garbage Out; Even before my first high school Computer Class back in 1982 this term was well known to me and my few programmer friends. It is up there with Goto considered harmful. This blog tries to explain the why GIGO is no excuse for failure in your own code: Recently, while [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=113&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>GIGO, <a href="http://en.wikipedia.org/wiki/Garbage_in,_garbage_out"><strong>Garbage In, Garbage Out</strong></a>; Even before my first high school Computer Class back in 1982 this term was well known to me and my few programmer friends. It is up there with <a href="http://www.acm.org/classics/oct95/"><strong>Goto considered harmful</strong></a>. This blog tries to explain the why GIGO is no excuse for failure in your own code:</p>
<p>Recently, while on a group cycle ride a fellow rider’s lack of experience/ judgment in jumping a road hazard led to reasonably serious injuries on my part. Was it my fault? Well, he lost control while jumping falling on my bike and taking it down. Still I partially blame myself; I had never seen this guy cycle before, and just assumed he knew how to hop a bike over obstacles. In future when such an obstacle arises, I’ll be very alert for problems and maintain a good distance from unknown cyclists when potential danger arises.</p>
<p>We can do the same in programming. The recent <a href="http://dotnetworkaholics.com/blog/archive/2004/07/25/146.aspx"><strong>Fail-Fast post</strong></a> highlights one such technique. In <a href="http://www.cc2e.com/"><strong>Code Complete 2</strong></a> Steve McConnell collectively groups such techniques as Defensive Programming. This chapter should be read by anyone who writes code for a living. He correctly points out that a fail-fast technique is not always the correct action. Over the last eleven years I have exclusively written serious business applications that often work with financial data. In these cases if an error occurs we would rather fail in a hard manner than have the code work in an inconsistent state:</p>
<p>“A dead program normally does a lot less damage than a crippled one”</p>
<p>But, what if you are writing a video game, or the error happens in simply rendering data to the screen. In such cases a graceful recovery option may be better. Would you rather have Windows crash, or show a desktop icon using the wrong colors?</p>
<p>The chapter is too long to do justice in a blog post. It covers sub-topics including Assertions, Barricades, Graceful Recovery options, Robustness v’s Correctness and Exceptions. At the bare minimum skim-read all the sections (although the Exception section is pretty weak IMHO).</p>
<p>Certainly one project I participated on in 1997 suffered politically because it was the GUI to a lousy messaging system, which feed the GUI with bad data. My manager’s defense was ‘Garbage In, Garbage Out’, and it fell on death ears. With the hindsight of Steve McConnell’s wisdom, if we had Barricaded our code from bad data then fighting politics would have been much easier. The manager could have attended meetings with<br />
the log from the Barricade Layer, proving in black and white where the problems lay. Both teams would then have been able to solve the problems much quicker, without escalating it up the management chain.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetworkaholic.wordpress.com/113/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetworkaholic.wordpress.com/113/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetworkaholic.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetworkaholic.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetworkaholic.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetworkaholic.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetworkaholic.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetworkaholic.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetworkaholic.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetworkaholic.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetworkaholic.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetworkaholic.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetworkaholic.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetworkaholic.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetworkaholic.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetworkaholic.wordpress.com/113/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=113&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetworkaholic.com/2004/09/07/defensive-programming-%e2%80%93-gigo-no-longer-washes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4dc3efce8716699965ae2767d9fa4728?s=96&#38;d=retro&#38;r=G" medium="image">
			<media:title type="html">dotnetworkaholic</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.Net Cross Application Cookie Sharing</title>
		<link>http://dotnetworkaholic.com/2004/08/08/cross-application-cookie-sharing/</link>
		<comments>http://dotnetworkaholic.com/2004/08/08/cross-application-cookie-sharing/#comments</comments>
		<pubDate>Sun, 08 Aug 2004 13:56:00 +0000</pubDate>
		<dc:creator>dotnetworkaholic</dc:creator>
				<category><![CDATA[Development (General)]]></category>

		<guid isPermaLink="false">http://dotnetworkaholic.com/cross-application-cookie-sharing/</guid>
		<description><![CDATA[Several companies running ASP.Net experience this problem. They have several web applications and need common authentication. Out of the box ASP.Net makes the user login in to each different application. I know of several organizations where this was a frustration to hundreds if not thousands of user. Luckily the fix is trivial. Open up machine.config [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=115&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Several companies running ASP.Net experience this problem. They have several web applications and need common authentication. Out of the box ASP.Net makes the user login in to each different application. I know of several organizations where this was a frustration to hundreds if not thousands of user.</p>
<p align="left">    Luckily the fix is trivial. Open up machine.config (beg, grovel, kiss the feet of your sys-admin if necessary) and make this change:</p>
<p><strong>Original machine.config entry:<br />
</strong><br />
<font face="Courier New" size="2">&lt;machineKey validationKey=&#8221;AutoGenerate<strong>,IsolateApps</strong>&#8221; decryptionKey=&#8221;AutoGenerate&#8221; validation=&#8221;SHA1&#8243;/&gt;</font></p>
<p><font face="Courier New"><font face="Times New Roman" size="3"><strong>To enable sharing of cookie authentication:<br />
</strong><font face="Courier New"><br />
<font size="2">&lt;machineKey validationKey=&#8221;AutoGenerate&#8221; decryptionKey=&#8221;AutoGenerate&#8221; validation=&#8221;SHA1&#8243;/&gt;</font></font></font></font></p>
<p><font face="Courier New">&gt;&gt;<span style="font-size:8pt;font-family:Courier;"><font face="Times New Roman" size="3">Totally trivial change that took under five minutes of searching documentation but I bet many organizations are struggling with separate logins even today. All the more reason to hire a Microsoft Certified .Net consultant [shameless plug!].</font></span> </font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetworkaholic.wordpress.com/115/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetworkaholic.wordpress.com/115/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetworkaholic.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetworkaholic.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetworkaholic.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetworkaholic.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetworkaholic.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetworkaholic.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetworkaholic.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetworkaholic.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetworkaholic.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetworkaholic.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetworkaholic.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetworkaholic.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetworkaholic.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetworkaholic.wordpress.com/115/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=115&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetworkaholic.com/2004/08/08/cross-application-cookie-sharing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4dc3efce8716699965ae2767d9fa4728?s=96&#38;d=retro&#38;r=G" medium="image">
			<media:title type="html">dotnetworkaholic</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.Net DataGrids one button Update</title>
		<link>http://dotnetworkaholic.com/2004/08/01/aspnet-datagrids-one-button-to-update-them-all/</link>
		<comments>http://dotnetworkaholic.com/2004/08/01/aspnet-datagrids-one-button-to-update-them-all/#comments</comments>
		<pubDate>Sun, 01 Aug 2004 12:20:00 +0000</pubDate>
		<dc:creator>dotnetworkaholic</dc:creator>
				<category><![CDATA[Development (General)]]></category>

		<guid isPermaLink="false">http://dotnetworkaholic.com/aspnet-datagrids-one-button-to-update-them-all/</guid>
		<description><![CDATA[It is while since I wrote this code-snippet, but at the time many DataGrid experts said it could not be done. After about twenty minutes of trying to understand some DataGrid events a working solution was found: if (this.dataGrid.EditItemIndex &#62; -1) { // Update the DataGrid this.dataGrid_UpdateCommand( this.dataGrid, new DataGridCommandEventArgs( this.dataGrid.Items[this.dataGrid.EditItemIndex], this.dataGrid, new System.Web.UI.WebControls.CommandEventArgs(&#8220;Update&#8221;, &#8220;&#8221;))); [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=116&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It is while since I wrote this code-snippet, but at the time many DataGrid experts said it could not be done. After about twenty minutes of trying to understand some DataGrid events a working solution was found:</p>
<p><font face="Courier New"></font><font size="2"></font><font color="#0000ff">if</font> (<font color="#0000ff">this</font><font face="Courier New" size="2">.dataGrid.EditItemIndex &gt; -1)<br />
{<br />
</font><font face="Courier New"></font><font size="2"></font><font color="#808080"> // Update the DataGrid<br />
</font><font color="#0000ff"> this</font><font face="Courier New"></font><font size="2">.dataGrid_UpdateCommand(<br />
</font><font color="#0000ff"> this</font><font face="Courier New"></font><font size="2">.dataGrid,<br />
</font><font color="#0000ff"> new</font><font face="Courier New"></font><font size="2"> DataGridCommandEventArgs(<br />
</font><font color="#0000ff"> this</font>.dataGrid.Items[<font color="#0000ff">this</font><font face="Courier New"></font><font size="2">.dataGrid.EditItemIndex],<br />
</font><font color="#0000ff"> this</font><font face="Courier New"></font><font size="2">.dataGrid,<br />
</font><font color="#0000ff"> new</font> System.Web.UI.WebControls.<font color="#008080">CommandEventArgs</font>(<font color="#800000">&#8220;Update&#8221;</font>, <font color="#800000">&#8220;&#8221;</font><font face="Courier New" size="2">)));<br />
}</font></p>
<p>Not a pretty event call but it works. On my last ASP.Net project several pages used one Update Button to perform updates on three or more DataGrids simultaneously. If your code forces users to click several update buttons, then use of this code may just make them a little happier.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetworkaholic.wordpress.com/116/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetworkaholic.wordpress.com/116/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetworkaholic.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetworkaholic.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetworkaholic.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetworkaholic.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetworkaholic.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetworkaholic.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetworkaholic.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetworkaholic.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetworkaholic.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetworkaholic.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetworkaholic.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetworkaholic.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetworkaholic.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetworkaholic.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=116&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetworkaholic.com/2004/08/01/aspnet-datagrids-one-button-to-update-them-all/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4dc3efce8716699965ae2767d9fa4728?s=96&#38;d=retro&#38;r=G" medium="image">
			<media:title type="html">dotnetworkaholic</media:title>
		</media:content>
	</item>
		<item>
		<title>Fail-Fast Pattern/Policy</title>
		<link>http://dotnetworkaholic.com/2004/07/25/fail-fast-pattern/</link>
		<comments>http://dotnetworkaholic.com/2004/07/25/fail-fast-pattern/#comments</comments>
		<pubDate>Sun, 25 Jul 2004 13:57:00 +0000</pubDate>
		<dc:creator>dotnetworkaholic</dc:creator>
				<category><![CDATA[Development (General)]]></category>

		<guid isPermaLink="false">http://dotnetworkaholic.com/fail-fast-patternpolicy-fail-early-with-context/</guid>
		<description><![CDATA[How often have you had to fix a run-time error and taken hours or even days to track down the root cause? Using the Fail-Fast policy can all but eliminate such troubles. The key concept is to fail early, that is as soon as you can programmatically detect bad data exists throw an exception reporting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=117&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>How often have you had to fix a run-time error and taken hours or even days to track down the root cause? Using the Fail-Fast policy can all but eliminate such troubles.</p>
<p>The key concept is to <em>fail early</em>, that is as soon as you can programmatically detect bad data exists throw an exception reporting <em>useful contextual information</em>.</p>
<p>e.g.<br />
<font face="Courier New"></font><font color="#0000ff">using</font> System.Reflection;<br />
&#8230;..<br />
<font color="#008080">DataRow</font> drWorkingData = someoneElseClass.FindTheRow(iPrimaryKey);<br />
<font color="#0000ff">if</font> (drWorkingData == <font color="#0000ff">null</font>)<br />
<font color="#0000ff">throw</font> <font color="#0000ff">new</font> <font color="#008080">ApplicationException</font>(<br />
<font color="#800000">&#8220;Failed to find data for Primary Key &gt;&#8221;</font> + iPrimaryKey + <font color="#800000">&#8220;&lt;&#8221;</font> +<br />
<font color="#800000">&#8220;["</font> + <font color="#008080">MethodInfo</font>.GetCurrentMethod().DeclaringType.FullName +<br />
<font color="#800000">"."</font> +  <font color="#008080">MethodInfo</font>.GetCurrentMethod().Name + <font color="#800000">"()]&#8220;</font>);</p>
<p>In this example had we not used a Fail-Fast policy the code would have continued until drWorkingData was referenced, at which point the run-time would automatically throw a null object exception. If you have debugged much code in your life, you will realize that this error could be thrown quite a distance from the original source of the error.</p>
<p>Note the use of reflection to obtain the location of the error. This is my most prevalent cut-and-paste reuse. An obvious improvement would be to encapsulate it in a utility class, and walk a step up the call-stack to report the method&#8217;s class and name. That is beyond my knowledge of .Net Reflection.</p>
<p>Also note that instead of using ApplicationException I always use a custom Exception called FailFastException which makes it very easy to trap such errors in a central location and report/ log them in a consistent fashion.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetworkaholic.wordpress.com/117/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetworkaholic.wordpress.com/117/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetworkaholic.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetworkaholic.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetworkaholic.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetworkaholic.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetworkaholic.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetworkaholic.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetworkaholic.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetworkaholic.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetworkaholic.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetworkaholic.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetworkaholic.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetworkaholic.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetworkaholic.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetworkaholic.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetworkaholic.com&#038;blog=20549795&#038;post=117&#038;subd=dotnetworkaholic&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetworkaholic.com/2004/07/25/fail-fast-pattern/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4dc3efce8716699965ae2767d9fa4728?s=96&#38;d=retro&#38;r=G" medium="image">
			<media:title type="html">dotnetworkaholic</media:title>
		</media:content>
	</item>
	</channel>
</rss>
