<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>.NET (General)</title>
        <link>http://geekswithblogs.net/sdorman/category/4832.aspx</link>
        <description>General .NET 2.0 related topics.
</description>
        <language>en-US</language>
        <copyright>Scott Dorman</copyright>
        <managingEditor>sj_dorman@hotmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <creativeCommons:license>http://creativecommons.org/licenses/by/3.0/us/</creativeCommons:license>
        <item>
            <title>Null Object pattern follow up</title>
            <link>http://geekswithblogs.net/sdorman/archive/2008/07/04/null-object-pattern-follow-up.aspx</link>
            <description>&lt;p&gt;My earlier post on the &lt;a href="http://geekswithblogs.net/sdorman/archive/2008/05/25/null-object-pattern.aspx"&gt;Null Object pattern&lt;/a&gt; led to a few critiques about the fact that I was presenting an extension method to do what is essentially a very simple logical test, and, as a result, doesn’t provide much value.&lt;/p&gt;  &lt;p&gt;For reference, here is the original extension method from that post&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; padding-left: 4px; font-size: 8pt; border-top: gray 1px solid; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; NullObjectExtenstions
{
    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; IsNull(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; source)
    {
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (source == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Yes, this is an extremely simple method and performs a very basic logical test. However, consider the static IsNullOrEmtpy function on String (taken from &lt;a href="http://www.aisto.com/roeder/dotnet/" target="_blank"&gt;Reflector&lt;/a&gt;):&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; padding-left: 4px; font-size: 8pt; border-top: gray 1px solid; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; IsNullOrEmpty(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;)
{
    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;value&lt;/span&gt; != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
    {
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;value&lt;/span&gt;.Length == 0);
    }
    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;I would argue that this is a relatively simple method and performs two very basic logical tests. What is the benefit to using IsNullOrEmpty? In a word, &lt;strong&gt;&lt;u&gt;consistency&lt;/u&gt;&lt;/strong&gt;. By using IsNullOrEmpty, I know that every time I need to perform this test it is executing the exact same code in the same order. I don’t have to worry about someone accidentally testing “Length == 0” before the “!= null” and causing a NullReferenceExcpetion.&lt;/p&gt;

&lt;p&gt;This same benefit applies to the IsNull extension method. It introduces that consistency (although I agree this test is still very trivial) for testing nullability. As I mentioned in my comments, the better choice for the extension method would probably have been an IsNotNull method. Here is a more complete NullObjectExtensions class:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; padding-left: 4px; font-size: 8pt; border-top: gray 1px solid; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; height: 246px; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; NullObjectExtenstions
{
    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; IsNull&amp;lt;T&amp;gt;(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; T source) &lt;span style="color: #0000ff"&gt;where&lt;/span&gt; T : &lt;span style="color: #0000ff"&gt;class&lt;/span&gt;
    {
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (source == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);
    }

    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; IsNotNull&amp;lt;T&amp;gt;(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; T source) &lt;span style="color: #0000ff"&gt;where&lt;/span&gt; T : &lt;span style="color: #0000ff"&gt;class&lt;/span&gt;
    {
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (source != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px; display: inline" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5188f4ff-65a3-4195-a276-e38d14fbd477" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/CSharp" rel="tag"&gt;CSharp&lt;/a&gt;, &lt;a href="http://technorati.com/tags/.NET" rel="tag"&gt;.NET&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123582"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123582" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sdorman/aggbug/123582.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Dorman</dc:creator>
            <guid>http://geekswithblogs.net/sdorman/archive/2008/07/04/null-object-pattern-follow-up.aspx</guid>
            <pubDate>Fri, 04 Jul 2008 13:51:08 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sdorman/comments/123582.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sdorman/archive/2008/07/04/null-object-pattern-follow-up.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sdorman/comments/commentRss/123582.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/sdorman/services/trackbacks/123582.aspx</trackback:ping>
        </item>
        <item>
            <title>What is &amp;ldquo;Defensive Programming&amp;rdquo;?</title>
            <link>http://geekswithblogs.net/sdorman/archive/2008/07/04/what-is-ldquodefensive-programmingrdquo.aspx</link>
            <description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;My post on the &lt;a title="Null Object pattern" href="http://geekswithblogs.net/sdorman/archive/2008/05/25/null-object-pattern.aspx"&gt;Null Object pattern&lt;/a&gt; has generated some interesting dialog. One of the trends that I have seen is the idea that defensive programming means your code should fail as early as possible. I couldn’t agree less.&lt;/p&gt;  &lt;p&gt;According to Wikipedia,&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;&lt;a href="http://en.wikipedia.org/wiki/Defensive_programming"&gt;Defensive programming&lt;/a&gt;&lt;/b&gt; is a form of &lt;a href="http://en.wikipedia.org/wiki/Defensive_design"&gt;defensive design&lt;/a&gt; intended to ensure the continuing function of a piece of &lt;a href="http://en.wikipedia.org/wiki/Software"&gt;software&lt;/a&gt; in spite of unforeseeable usage of said software. The idea can be viewed as reducing or eliminating the prospect of &lt;a href="http://en.wikipedia.org/wiki/Murphy%27s_Law"&gt;Murphy's Law&lt;/a&gt; having effect. Defensive programming techniques are used especially when a piece of software could be misused mischievously or inadvertently to catastrophic effect.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;While this is a good definition, I think it still leaves much to be desired. The Wikipedia entry goes on to say that defensive programming is one approach to improving software quality by “Making the software behave in a predictable manner despite unexpected input or user actions.”&lt;/p&gt;  &lt;p&gt;I think this is the closest definition that actually conveys what defensive programming is all about. The idea behind defensive programming is that the application should behave in a consistent and predictable manner even in the case of unexpected conditions.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;There are a lot of different ways to achieve this and they are all different depending on what you are trying to accomplish with the code, the programming language, and the control structures being used. For example, considering a switch statement:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; padding-left: 4px; font-size: 8pt; border-top: gray 1px solid; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;switch&lt;/span&gt; (Orientation)
{
   &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; Orientation.Horizontal:
      &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;

   &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; Orientation.Vertical:
      &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;This is perfectly acceptable code, right? Remembering that enumerations are simply numeric (generally integer) values, it is entirely possible for this switch to get passed a numeric value that doesn’t correspond to either Horizontal or Vertical. In that case, there is the possibility of the switch, or code following the switch, to crash. One option to handle this would be to add a default case to the switch:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; padding-left: 4px; font-size: 8pt; border-top: gray 1px solid; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;switch&lt;/span&gt; (Orientation)
{
    &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; Orientation.Horizontal:
        &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;

    &lt;span style="color: #0000ff"&gt;case&lt;/span&gt; Orientation.Vertical:
        &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;

    &lt;span style="color: #0000ff"&gt;default&lt;/span&gt;:
        &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;In the default case you could throw an exception (if that’s the appropriate behavior) or, more likely, you take some action that ensures either the remaining code doesn’t execute or at least doesn’t crash.&lt;/p&gt;

&lt;p&gt;Looking at another example, this time casting, shows some other ways to program defensively. A common scenario for casting is in UI programming and handling events.&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; padding-left: 4px; font-size: 8pt; border-top: gray 1px solid; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; button1_Click(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, EventArgs e)
{
    ((Button)sender).Text = &lt;span style="color: #006080"&gt;"You pressed a button"&lt;/span&gt;;
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Again, this code looks perfectly reasonable and will work just fine until someone accidentally assigns this event handler to something other than a button. Once that happens, the code will crash since sender won’t be castable to a Button. There are several different ways to handle this but the simplest (at least in my opinion) is&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; padding-left: 4px; font-size: 8pt; border-top: gray 1px solid; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; button1_Click(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, EventArgs e)
{
    Button button = sender &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; Button;
    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (button != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)
    {
        button.Text = &lt;span style="color: #006080"&gt;"You pressed a button"&lt;/span&gt;;
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Yes, it is a bit more code but it also guarantees that no matter what happens if the object that raised the event is not a Button, the code won’t crash. You could have chosen to throw an exception (or just let the exception generated by the runtime bubble up the call stack until it’s handled, but that may not be desirable depending on what you are doing.&lt;/p&gt;

&lt;p&gt;The bottom line is that catching exceptions (not throwing them, but catching them…and all exceptions will eventually be caught, but possibly not in a way you intended) is expensive and if there are techniques that allow your program to continue functioning properly or otherwise gracefully handle exceptional conditions, known as “defensive programming”, you should opt for that approach.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div style="padding-right: 0px; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px; display: inline" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:517fb5fe-e548-43be-9602-2dea0d3d5c4f" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/.NET" rel="tag"&gt;.NET&lt;/a&gt;, &lt;a href="http://technorati.com/tags/CSharp" rel="tag"&gt;CSharp&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123581"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123581" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sdorman/aggbug/123581.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Dorman</dc:creator>
            <guid>http://geekswithblogs.net/sdorman/archive/2008/07/04/what-is-ldquodefensive-programmingrdquo.aspx</guid>
            <pubDate>Fri, 04 Jul 2008 13:26:10 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sdorman/comments/123581.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sdorman/archive/2008/07/04/what-is-ldquodefensive-programmingrdquo.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sdorman/comments/commentRss/123581.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/sdorman/services/trackbacks/123581.aspx</trackback:ping>
        </item>
        <item>
            <title>Null Object pattern</title>
            <link>http://geekswithblogs.net/sdorman/archive/2008/05/25/null-object-pattern.aspx</link>
            <description>&lt;p&gt;I've been trying to catch up on my reading and came across this &lt;a title="Avoid returning " href="http://weblogs.asp.net/fredriknormen/archive/2008/05/22/avoid-returning-quot-null-quot-and-use-the-null-object-pattern.aspx" target="_blank" pattern??="pattern??" object="Object" null="Null" the="the" use="use" and="and" null?="null?"&gt;post&lt;/a&gt; by &lt;a href="http://weblogs.asp.net/fredriknormen/default.aspx" target="_blank"&gt;Fredrik Normén&lt;/a&gt; where he raises the question about returning null or using the &lt;a href="http://en.wikipedia.org/wiki/Null_object_pattern" target="_blank"&gt;Null Object pattern&lt;/a&gt;. Interestingly enough, last month while I was in Seattle for the 2008 MVP Summit I had a very similar discussion. The end result of that discussion was that null objects, and nullability in general, ideally should be treated as a "first-class" citizen in the CLR. This means that if you try to execute a method on a null object you get a null back in return rather than a &lt;a href="http://msdn.microsoft.com/library/system.nullreferenceexception.aspx" target="_blank"&gt;NullReferenceException&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I tend to follow a very similar philosophy as Fredrik in that I return null in some circumstances and empty collections (or other appropriate defaults) in others. I think this style has grown from the fact that nullability has never been a first class citizen in most programming languages.&lt;/p&gt;  &lt;p&gt;A few of the comments suggested the use of an extension method to accomplish Fredrik's idea of an "IsNull" property. Since we only have the ability to create extension methods, I created an extension method called IsNull that extends &lt;a href="http://msdn.microsoft.com/library/system.object.aspx" target="_blank"&gt;Object Class (System)&lt;/a&gt; to see if this would work. &lt;/p&gt;  &lt;p&gt;This is, perhaps, the simplest extension method I've seen and worked with. The extension method is:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; height: 134px; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; NullObjectExtenstions&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; IsNull(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt; &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; source)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (source == &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Using this extension method is also just as easy. Here is a simple console application I wrote to verify that this does indeed work:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; height: 325px; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Program&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Main(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] args)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; x = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;         List&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt; y = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;         CultureInfo culture = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;         Debug.WriteLine(x.IsNull());&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt;         Debug.WriteLine(y.IsNull());&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  12:&lt;/span&gt;         Debug.WriteLine(culture.IsNull());&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  13:&lt;/span&gt;  &lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  14:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!culture.IsNull())&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  15:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  16:&lt;/span&gt;             Debug.WriteLine(culture.DisplayName);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  17:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  18:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  19:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The output of this application is:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; height: 74px; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; height: 59px; background-color: #f4f4f4; border-bottom-style: none"&gt;True
True
True&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The last call to &lt;em&gt;&lt;font face="Consolas"&gt;Debug.WriteLine(culture.DisplayName)&lt;/font&gt;&lt;/em&gt; is never executed since &lt;em&gt;&lt;font face="Consolas"&gt;culture.IsNull()&lt;/font&gt;&lt;/em&gt; returns true so we don't hit the &lt;a href="http://msdn.microsoft.com/library/system.nullreferenceexception.aspx" target="_blank"&gt;NullReferenceException&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122384"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122384" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sdorman/aggbug/122384.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Dorman</dc:creator>
            <guid>http://geekswithblogs.net/sdorman/archive/2008/05/25/null-object-pattern.aspx</guid>
            <pubDate>Sun, 25 May 2008 22:28:23 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sdorman/comments/122384.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sdorman/archive/2008/05/25/null-object-pattern.aspx#feedback</comments>
            <slash:comments>10</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sdorman/comments/commentRss/122384.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/sdorman/services/trackbacks/122384.aspx</trackback:ping>
        </item>
        <item>
            <title>MVP Summit 2008</title>
            <link>http://geekswithblogs.net/sdorman/archive/2008/04/19/mvp-summit-2008.aspx</link>
            <description>&lt;p&gt;I just got back from attending my first MVP Summit and have to say the level of access we received to the product teams and other people within Microsoft was outstanding. &lt;/p&gt;  &lt;p&gt;Since this was my first Summit, I don't really have a frame of reference to know how it compares to previous years, but it did quickly become apparent to me that Microsoft really does listen to community as much as they are able. Obviously some groups and products are better able to do this than others, but that seems to be mostly due to where they are in the product lifecycle.&lt;/p&gt;  &lt;p&gt;Going beyond the obvious technical and product information we received, the opportunity to network was equally impressive. With almost 1800 MVPs from around the world I was able to meet people from across the pond and locally, some of whom I already knew from online communities like &lt;a title="The Code Project - Free Source Code and Tutorials" href="http://www.codeproject.com/" target="_blank"&gt;The Code Project&lt;/a&gt; and &lt;a href="http://geekswithblogs.net" target="_blank"&gt;GeeksWithBlogs&lt;/a&gt;. The closing keynotes by &lt;a href="http://en.wikipedia.org/wiki/Ray_Ozzie" target="_blank"&gt;Ray Ozzie&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Steve_Ballmer" target="_blank"&gt;Steve Ballmer&lt;/a&gt; were less presentation and more direct question and answer periods. I've seen Steve Ballmer present before but never in this type of setting and with the amount of candor he displayed.&lt;/p&gt;  &lt;p&gt;Closing the Summit (and showing the real strength of the MVP community), what started out as a &lt;a href="http://www.devfish.net/fullblogitemview.aspx?blogid=517" target="_blank"&gt;Florida MVP Geek Lager&lt;/a&gt; quickly turned viral with &lt;a href="http://twitter.com" target="_blank"&gt;Twitter&lt;/a&gt; tweets and blog posts until approximately 75 (that was the last number I heard, but I left early) MVPs from around the U.S. (and I believe some other countries as well) descended on &lt;a title="Kells Irish Restaurant &amp;amp; Pub" href="http://www.kellsirish.com/seattle/index.php"&gt;Kells Irish Restaurant &amp;amp; Pub&lt;/a&gt; (kudos to the bar staff that night, they did an incredible job keeping up with everyone!)&lt;/p&gt;  &lt;p&gt;Next year's Summit has already been confirmed for March 1 - 4, 2009. I'm already starting to look for flights.&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e7cd8365-14cf-4e6e-a24a-7380b25c16e0" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;i&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/MVP%20Summit" rel="tag"&gt;MVP Summit&lt;/a&gt;&lt;/i&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121387"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121387" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sdorman/aggbug/121387.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Dorman</dc:creator>
            <guid>http://geekswithblogs.net/sdorman/archive/2008/04/19/mvp-summit-2008.aspx</guid>
            <pubDate>Sat, 19 Apr 2008 17:05:34 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sdorman/comments/121387.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sdorman/archive/2008/04/19/mvp-summit-2008.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sdorman/comments/commentRss/121387.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/sdorman/services/trackbacks/121387.aspx</trackback:ping>
        </item>
        <item>
            <title>Book Review: ASP.NET Data Presentation Controls Essentials</title>
            <link>http://geekswithblogs.net/sdorman/archive/2008/03/28/book-review-asp.net-data-presentation-controls-essentials.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://www.packtpub.com/#" target="_blank"&gt;&lt;img style="margin: 0px 5px 0px 0px" height="123" alt="1847193951" src="http://geekswithblogs.net/images/geekswithblogs_net/sdorman/WindowsLiveWriter/Boo.NETDataPresentationControlsEssential_103C1/1847193951_3.png" width="97" align="left" border="0" /&gt;&lt;/a&gt;If you are an ASP.NET developer or want to become one,  there are numerous books available that talk about the ASP.NET framework and/or how to build web sites using ASP.NET. &lt;a href="http://www.packtpub.com" target="_blank"&gt;Pact Publishing&lt;/a&gt; has a book that focuses specifically on the data presentation controls that are available in ASP.NET, including ASP.NET 3.5 called &lt;u&gt;&lt;a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;amp;location=http%3A%2F%2Fwww.amazon.com%2Fexec%2Fobidos%2FASIN%2F1847193951&amp;amp;tag=scotdorm-20&amp;amp;linkCode=ur2&amp;amp;camp=1789&amp;amp;creative=9325" target="_blank"&gt;ASP.NET Data Presentation Controls Essentials&lt;/a&gt;&lt;/u&gt; by Joydip Kanjilal.&lt;/p&gt;  &lt;p&gt;The book provides a good introduction to the basics of how data binding in ASP.NET works and then expands on that introduction to cover the new (in ASP.NET 2.0) data source controls, including the Object, SQL, and XML data source controls.&lt;/p&gt;  &lt;p&gt;From there, the book focuses a separate chapter on the working with each of the different types of data presentation controls:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;List Controls      &lt;ul&gt;       &lt;li&gt;ListBox &lt;/li&gt;        &lt;li&gt;DropDownList &lt;/li&gt;        &lt;li&gt;CheckBoxList &lt;/li&gt;        &lt;li&gt;BulletedList &lt;/li&gt;        &lt;li&gt;RadioButtonList &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Repeater &lt;/li&gt;    &lt;li&gt;DataList &lt;/li&gt;    &lt;li&gt;DataGrid &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The List Controls chapter covers the basics of how to bind data to each of the different controls and presents a simple working example for each one. It also walks you through implementing a custom list control, by creating a custom CheckBoxList control. The chapter on the Repeater control shows how to do basic data paging and sorting, while the DataList and DataGrid chapters also show how to implement data editing.&lt;/p&gt;  &lt;p&gt;The remainder of the book focuses on how to display different views of your data using the GridView and offers a good comparison between the GridView and DataGrid controls and then taking a deeper look at using the DetailsView, FormView and TreeView controls. The techniques presented in these two chapters show explain of the more common visual modifications in fairly simple to understand terms, including how to change the row color using a checkbox, displaying a cell tool tip and how to implement a hierarchical GridView. The last chapter focuses on LINQ and how to query data using LINQ to bind to the Listview and DataPager controls.&lt;/p&gt;  &lt;p&gt;Overall, while the style of writing in the book was a little hard to follow at times, the technical content of the book appeared to be both accurate and thorough, providing a very good look at the various data-bound presentation controls available in ASP.NET.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120834"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120834" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sdorman/aggbug/120834.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Dorman</dc:creator>
            <guid>http://geekswithblogs.net/sdorman/archive/2008/03/28/book-review-asp.net-data-presentation-controls-essentials.aspx</guid>
            <pubDate>Fri, 28 Mar 2008 22:52:08 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sdorman/comments/120834.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sdorman/archive/2008/03/28/book-review-asp.net-data-presentation-controls-essentials.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sdorman/comments/commentRss/120834.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/sdorman/services/trackbacks/120834.aspx</trackback:ping>
        </item>
        <item>
            <title>Orlando Code Camp 2008 - Thanks!</title>
            <link>http://geekswithblogs.net/sdorman/archive/2008/03/23/orlando-code-camp-2008---thanks.aspx</link>
            <description>&lt;p&gt;I just got back from Orlando Code Camp 2008 and wanted to thank everyone who was involved in organizing it and everyone who came out to attend sessions. I believe there were about 250 people attending with about 40 speakers presenting on over 50 topics.&lt;/p&gt;  &lt;p&gt;For those of you who attended my talks on memory management fundamentals - "Thank you!". I had a great turnout at both sessions, with about 18 people at each. I got a lot of great questions from everyone and some really good feedback as well. If you missed the talks, or attended and want a copy of the slides, they are available from my SkyDrive public folder:&lt;/p&gt;  &lt;p&gt; &lt;iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-93d618d639ec9651.skydrive.live.com/embedrowdetail.aspx/Public/Code%20Camp/2008/Orlando" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:9a1ade25-6cf0-4c7d-ac0a-b49e9b92af20" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;i&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/CodeCamp" rel="tag"&gt;CodeCamp&lt;/a&gt;&lt;/i&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120716"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120716" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sdorman/aggbug/120716.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Dorman</dc:creator>
            <guid>http://geekswithblogs.net/sdorman/archive/2008/03/23/orlando-code-camp-2008---thanks.aspx</guid>
            <pubDate>Sun, 23 Mar 2008 23:58:16 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sdorman/comments/120716.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sdorman/archive/2008/03/23/orlando-code-camp-2008---thanks.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sdorman/comments/commentRss/120716.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/sdorman/services/trackbacks/120716.aspx</trackback:ping>
        </item>
        <item>
            <title>New Lineup of SlickEdit Tools</title>
            <link>http://geekswithblogs.net/sdorman/archive/2008/03/20/new-lineup-of-slickedit-tools.aspx</link>
            <description>&lt;p&gt;I have talked about the SlickEdit Tools and Gadgets in the past (&lt;a title="SlickEdit Gadgets" href="http://geekswithblogs.net/sdorman/archive/2007/02/18/106641.aspx"&gt;here&lt;/a&gt; and &lt;a title="SlickEdit Gadgets for Visual Studio 2008" href="http://geekswithblogs.net/sdorman/archive/2007/08/15/SlickEdit-Gadgets-for-Visual-Studio-2008.aspx"&gt;here&lt;/a&gt;) and have always been impressed with both of them. Previously, the SlickEdit Tools were only available for Visual Studio 2005. Now that Visual Studio 2008 is here, SlickEdit has released an update that works with both VS2005 and VS2008.&lt;/p&gt; &lt;p&gt;The catch here is that this is much more than a simple update. The major difference is that the tools have been organized into two products: the &lt;a href="http://www.slickedit.com/index.php?option=com_content&amp;amp;task=view&amp;amp;id=486&amp;amp;Itemid=57" target="_blank"&gt;Editing Toolbox&lt;/a&gt; (&lt;a href="http://www.slickedit.com/images/stories/products/SlickEditTools/editingtoolbox3172008.pdf" target="_blank"&gt;datasheet&lt;/a&gt;), which contains all of the same tools available in version 1.0, and the &lt;a href="http://www.slickedit.com/index.php?option=com_content&amp;amp;task=view&amp;amp;id=488&amp;amp;Itemid=57" target="_blank"&gt;Versioning Toolbox&lt;/a&gt; (&lt;a href="http://www.slickedit.com/images/stories/products/SlickEditTools/versioningtoolbox3172008.pdf" target="_blank"&gt;datasheet&lt;/a&gt;).&lt;/p&gt; &lt;p&gt;The Editing Toolbox provides a very useful collection of utilities that add convenience to your daily programming tasks by:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Aliases and Acronyms:&lt;br /&gt;&lt;/strong&gt;Use directory aliases to save keystrokes and mouse usage when opening files. Use acronym expansion to save keystrokes when typing class, namespace, or function names in your code. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Auto Code Doc Viewer&lt;br /&gt;&lt;/strong&gt;Extract header comments into MSDN-like documentation, fully linked HTML help that can be browsed in Visual Studio as a tool window and exported for sharing with others. &lt;/li&gt; &lt;li&gt;&lt;em&gt;&lt;strong&gt;Code Annotations &lt;br /&gt;&lt;/strong&gt;Insert comments and notes about code without actually modifying the source file. &lt;/em&gt;&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Comment Wrapping &lt;br /&gt;&lt;/strong&gt;Enable automatic wrapping of any type of multi-line comment as you type. You can also reflow existing comments in the current file.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Icon Extractor &lt;/strong&gt;&lt;br /&gt;Simplify the task of finding quality icons and applying them to your applications. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Quick Profiling &lt;br /&gt;&lt;/strong&gt;Fine-tune your profiling to get information about a specific section of code. This feature allows you to time many cases that are not possible with standard profilers, such as timing complex loops, recursive functions, and the time between an object’s creation and disposal.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Regex Evaluator &lt;/strong&gt;&lt;br /&gt;Interactively create and test regular expressions, which are used to express text patterns for searching. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Code Navigation &lt;br /&gt;&lt;/strong&gt;Use keyboard shortcuts to jump from a symbol to its definition and to list all references for the current symbol. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Word Completion &lt;br /&gt;&lt;/strong&gt;Use commands to search for and insert additional text from a matching string. &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;img style="border-right: 0px; border-top: 0px; margin: 0px 5px 0px 0px; border-left: 0px; border-bottom: 0px" border="0" alt="image" align="left" src="http://geekswithblogs.net/images/geekswithblogs_net/sdorman/WindowsLiveWriter/NewLineupofSlickEditTools_D710/image_5.png" width="358" height="321" /&gt;The Code Annotations feature is new in version 2.0 and is a great feature for collaboration and code reviews. It allows you to store annotations marked as "Bug", "Comment", and "Task". These annotations don't actually change the source file, they are stored in an external file. Annotations can be scoped as personal, project, or workspace.&lt;/p&gt; &lt;p&gt;The really nice thing about the Code Annotations window is that, unlike the Visual Studio Task List, the annotations are still displayed even when the source file is closed.&lt;/p&gt; &lt;p&gt;You can see all of the information about the annotation at a glance, including the full code element that is associated with that annotation.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/sdorman/WindowsLiveWriter/NewLineupofSlickEditTools_D710/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" border="0" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/sdorman/WindowsLiveWriter/NewLineupofSlickEditTools_D710/image_thumb_1.png" width="644" height="188" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The Versioning Toolbox allows you to view your source control activity and help you understand when and where changes are being made and by whom. Easily understand and navigate your source code by using these powerful features: &lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Backup History &lt;br /&gt;&lt;/strong&gt;View, compare, and restore versions of files without having to use source control. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;CVS/SVN Source Control &lt;br /&gt;&lt;/strong&gt;Use CVS and Subversion source control commands directly in the Solution Explorer. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;DIFFzilla®&lt;br /&gt;&lt;/strong&gt;Provides editable dynamic differencing and merging for files, directories, and source trees. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Find Version &lt;br /&gt;&lt;/strong&gt;Find the versions of one or more files that match specific criteria, such as which files were checked in by a certain user over a certain amount of time. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Line Version Info &lt;/strong&gt;&lt;br /&gt;View details about the check-in that last affected any specific line in a source file. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Version Graphs &lt;br /&gt;&lt;/strong&gt;View graphs depicting different historical aspects and trends of selected source-controlled files. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Version History &lt;/strong&gt;&lt;br /&gt;View the history of each version of a source file, including check-in comments, date, author, branches, and labels. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Visualizations &lt;br /&gt;&lt;/strong&gt;Uses color schemes to visualize the version for each line of code in the editor window. Allows you to answer the questions: ‘Who wrote this?’ and ‘How old is this?’ Different color schemes allow you to focus on specific users, dates, or labels.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;I think the most promising features here are the Visualization and the fact that all of these utilities work with CVS, SVN, TFS, or VSS in exactly the same way. There is only support right now for TFS if you have TFS 2005 installed, but the developers at SlickEdit are working very hard on getting TFS 2008 support worked out, which will allow you to work with either TFS 2005 or 2008. This update should be available soon.&lt;/p&gt; &lt;p&gt;The best part of the new SlickEdit Tools is the price. Each Toolbox is available for $49. If you aren't sure if the tools are for you, &lt;a href="http://www.slickedit.com/content/view/408/244/" target="_blank"&gt;download the free trial&lt;/a&gt;. Once you install them, I think you'll find that they will quickly become part of your every day development experience.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120670"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120670" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sdorman/aggbug/120670.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Dorman</dc:creator>
            <guid>http://geekswithblogs.net/sdorman/archive/2008/03/20/new-lineup-of-slickedit-tools.aspx</guid>
            <pubDate>Thu, 20 Mar 2008 20:18:18 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sdorman/comments/120670.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sdorman/archive/2008/03/20/new-lineup-of-slickedit-tools.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sdorman/comments/commentRss/120670.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/sdorman/services/trackbacks/120670.aspx</trackback:ping>
        </item>
        <item>
            <title>How big is the .NET Framework?</title>
            <link>http://geekswithblogs.net/sdorman/archive/2008/03/18/how-big-is-the-.net-framework.aspx</link>
            <description>&lt;p&gt;No, this question isn't asking how much disk space is required by the Framework. It's really asking "How complex is the .NET Framework for developers?" As you might guess, the answer is: It's pretty complex.&lt;/p&gt;  &lt;p&gt;All joking aside, this is neither an uncommon nor unreasonable question and answer. The reality of it is that the .NET Framework is a very complicated application programming interface (API) but is designed in such a way to expose that complexity gradually (at least in most cases).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/brada/archive/2008/03/17/number-of-types-in-the-net-framework.aspx" target="_blank" rel="met"&gt;Brad Abrams&lt;/a&gt; has an excellent post that shows this complexity in a very easy to understand set of graphs. The side-benefit to these graphs is that they show the evolution of the Framework over time, not just the current release.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/sdorman/WindowsLiveWriter/Howbigisthe.NETFramework_14B3C/image_6_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="295" alt="image_6" src="http://geekswithblogs.net/images/geekswithblogs_net/sdorman/WindowsLiveWriter/Howbigisthe.NETFramework_14B3C/image_6_thumb.png" width="503" border="0" /&gt;&lt;/a&gt; &lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/sdorman/WindowsLiveWriter/Howbigisthe.NETFramework_14B3C/image_8_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="295" alt="image_8" src="http://geekswithblogs.net/images/geekswithblogs_net/sdorman/WindowsLiveWriter/Howbigisthe.NETFramework_14B3C/image_8_thumb.png" width="487" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/sdorman/WindowsLiveWriter/Howbigisthe.NETFramework_14B3C/image_10_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="295" alt="image_10" src="http://geekswithblogs.net/images/geekswithblogs_net/sdorman/WindowsLiveWriter/Howbigisthe.NETFramework_14B3C/image_10_thumb.png" width="499" border="0" /&gt;&lt;/a&gt; &lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/sdorman/WindowsLiveWriter/Howbigisthe.NETFramework_14B3C/image_12_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="295" alt="image_12" src="http://geekswithblogs.net/images/geekswithblogs_net/sdorman/WindowsLiveWriter/Howbigisthe.NETFramework_14B3C/image_12_thumb.png" width="491" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The interesting thing that these graphs show is that in every category the amount almost tripled between versions 1.0 and 3.5 of the Framework in almost 6 years. Given the complexity of a lot of the changes between versions that is an incredible amount of work.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120630"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120630" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sdorman/aggbug/120630.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Dorman</dc:creator>
            <guid>http://geekswithblogs.net/sdorman/archive/2008/03/18/how-big-is-the-.net-framework.aspx</guid>
            <pubDate>Wed, 19 Mar 2008 03:44:17 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sdorman/comments/120630.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sdorman/archive/2008/03/18/how-big-is-the-.net-framework.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sdorman/comments/commentRss/120630.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/sdorman/services/trackbacks/120630.aspx</trackback:ping>
        </item>
        <item>
            <title>NameValueCollection and .NET Configuration Files</title>
            <link>http://geekswithblogs.net/sdorman/archive/2008/03/16/namevaluecollection-and-.net-configuration-files.aspx</link>
            <description>&lt;p&gt;I spent most of yesterday trying to figure out how to make use of a &lt;a title="NameValueCollection Class" href="http://msdn2.microsoft.com/689y5thy.aspx" target="_blank"&gt;NameValueCollection&lt;/a&gt; in a .NET configuration file. After wasting almost the entire night fighting with this problem, I thought I would let everyone know that it is possible, and easier than you might think. (By the way, this was a clear case of working too long on the problem. After a good nights sleep, I solved this in under 5 minutes.)&lt;/p&gt;  &lt;p&gt;At this point you might wonder why this was so difficult. The largest and most significant problem is the fact that NameValueCollection isn't serializable (&lt;a href="http://support.microsoft.com/kb/814187" target="_blank"&gt;KB 814187&lt;/a&gt;). The reason for this is that NameValueCollection doesn't implement &lt;a title="ICollection Interface" href="http://msdn2.microsoft.com/b1ht6113.aspx" target="_blank"&gt;ICollection&lt;/a&gt; but extends &lt;a title="NameObjectCollectionBase Class" href="http://msdn2.microsoft.com/ts6a60s4.aspx" target="_blank"&gt;NameObjectCollectionBase&lt;/a&gt; instead. The recommended solution is to use a &lt;a title="SoapFormatter Class" href="http://msdn2.microsoft.com/5ktza7xf.aspx" target="_blank"&gt;SoapFormatter&lt;/a&gt; to serialize and deserialize the collection. While using the SoapFormatter does work, it seemed like a very complex solution for a seemingly simple problem.&lt;/p&gt;  &lt;p&gt;Not wanting to over-engineer my solution, I started searching the web for alternatives. I found several newsgroup postings that all said to use the SoapFormatter since that was the recommended solution and the only way to go. Not having drunk too much blue kool-aid, I kept searching. That search turned up an article by &lt;a title="Serialize NameValueCollection" href="http://nayyeri.net/blog/Serialize-NameValueCollection/" target="_blank"&gt;Keyvan Nayyeri&lt;/a&gt; that shows how to created a serializable NameValueCollection. This approach was intriguing and certainly seemed to be a more useful solution than using the SoapFormatter, but again it seemed like a lot of work.&lt;/p&gt;  &lt;p&gt;Keep in mind, all I wanted to be able to do in the configuration file was to create a section that looked like this:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;copyFiles&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="C:\Windows"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="*.dll"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;   &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="C:\Temp"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;copyFiles&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Continuing the search, I thought I found my answer. I stumbled across an &lt;a href="http://dotnet.org.za/ncode/archive/2007/01/19/net-how-to-use-custom-name-value-config-sections.aspx" target="_blank"&gt;article&lt;/a&gt; (".NET How To Create and Use Custom Name-Value Config Sections") that shows how to do this in 4 simple steps. Reading through the article, I realized that it is written using the the .NET 1.0 and 1.1 &lt;a title="ConfigurationSettings Class" href="http://msdn2.microsoft.com/kw224t90.aspx" target="_blank"&gt;ConfigurationSettings&lt;/a&gt;, which is provided for backwards compatibility only. Since the application I'm working on is .NET 3.5 and taking advantage of many of the new language features, I wanted to ensure that I wasn't using any deprecated classes.&lt;/p&gt;

&lt;p&gt;This is where I started running into additional problems. It seems that Microsoft provides a &lt;a title="NameValueSectionHandler Class" href="http://msdn2.microsoft.com/5fwwx482.aspx" target="_blank"&gt;NameValueSectionHandler&lt;/a&gt;, which the article makes us of. The problem is that NameValueSectionHandler is architected following the .NET 1.0/1.1 model and implements the &lt;a title="IConfigurationSectionHandler Interface" href="http://msdn2.microsoft.com/6950ee5e.aspx"&gt;System.Configuration.IConfigurationSectionHandler&lt;/a&gt; interface. This is great if you want to use the deprecated ConfigurationSettings class; if you want to use the recommended &lt;a title="ConfigurationManager Class" href="http://msdn2.microsoft.com/ms134260.aspx" target="_blank"&gt;System.Configuration.ConfigurationManager&lt;/a&gt; or &lt;a title="WebConfigurationManager Class" href="http://msdn2.microsoft.com/ms151430.aspx" target="_blank"&gt;System.Web.Configuration.WebConfigurationManager&lt;/a&gt; classes you are out of luck. They will only work with a class that derives from &lt;a title="ConfigurationSection Class" href="http://msdn2.microsoft.com/x0kca287.aspx" target="_blank"&gt;ConfigurationSection&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So, after all this I thought I was out of luck and would need to write my own configuration section handler. (Remember, this was about 1:00 AM.) After sleeping on it, I realized that there was a much simpler way. Along with the NameValueSectionHandler, Microsoft also implemented &lt;a title="NameValueConfigurationCollection Class" href="http://msdn2.microsoft.com/ms134603.aspx" target="_blank"&gt;NameValueConfigurationCollection&lt;/a&gt; and &lt;a title="NameValueConfigurationElement Class" href="http://msdn2.microsoft.com/ms134619.aspx" target="_blank"&gt;NameValueConfigurationElement&lt;/a&gt;, which derive from the appropriate configuration classes to be used by the ConfigurationManager. After seeing that, I realized that all I needed to do was implement a NameValueSection which derives from ConfigurationSection.&lt;/p&gt;

&lt;p&gt;This is where the solution becomes easy. In it's simplest most form, the NameValueSection looks like this:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; NameValueSection : ConfigurationSection&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt;     [ConfigurationProperty(&lt;span style="color: #006080"&gt;""&lt;/span&gt;, IsDefaultCollection = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)]&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; NameValueConfigurationCollection Settings&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;         get&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (NameValueConfigurationCollection)&lt;span style="color: #0000ff"&gt;base&lt;/span&gt;[&lt;span style="color: #006080"&gt;""&lt;/span&gt;];&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  10:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;  11:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;As you can see, this is pretty simple. In order to use it, you declare the section in your app.config file:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;sectionGroup&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="customSettings"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;section&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="copyFiles"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="NameValueSection, CustomConfiguration"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;sectionGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;copyFiles&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="C:\Windows"&lt;/span&gt; &lt;span style="color: #ff0000"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="*.dll"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;="C:\Temp"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;copyFiles&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;To access this configuration section in code, you simply need to do this:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   1:&lt;/span&gt; NameValueSection nameValueSection = ConfigurationManager.GetSection(&lt;span style="color: #006080"&gt;"copyFiles"&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; NameValueSection;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (nameValueSection != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   3:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   4:&lt;/span&gt;     NameValueConfigurationCollection settings = nameValueSection.Settings;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; key &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; settings.AllKeys)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   7:&lt;/span&gt;         Console.WriteLine(settings[key].Name + &lt;span style="color: #006080"&gt;": "&lt;/span&gt; + settings[key].Value);&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   8:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #606060"&gt;   9:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This is about as simple as it gets. Even though you aren't actually using the real NameValueCollection you are using the NameValueConfigurationCollection, which has almost identical behavior. This is the solution that I finally ended up implementing and it works great. As you can see, with a minimal amount of effort you are now able to use a NameValueCollection in your configuration files.&lt;/p&gt;

&lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:d6ec8741-e7ef-49b9-bbc5-e7512ab951ea" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;i&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/.NET" rel="tag"&gt;.NET&lt;/a&gt;, &lt;a href="http://technorati.com/tags/C#" rel="tag"&gt;C#&lt;/a&gt;, &lt;a href="http://technorati.com/tags/NameValueCollection" rel="tag"&gt;NameValueCollection&lt;/a&gt;, &lt;a href="http://technorati.com/tags/ConfigurationManager" rel="tag"&gt;ConfigurationManager&lt;/a&gt;&lt;/i&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120582"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120582" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sdorman/aggbug/120582.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Dorman</dc:creator>
            <guid>http://geekswithblogs.net/sdorman/archive/2008/03/16/namevaluecollection-and-.net-configuration-files.aspx</guid>
            <pubDate>Mon, 17 Mar 2008 00:00:02 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sdorman/comments/120582.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sdorman/archive/2008/03/16/namevaluecollection-and-.net-configuration-files.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sdorman/comments/commentRss/120582.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/sdorman/services/trackbacks/120582.aspx</trackback:ping>
        </item>
        <item>
            <title>Code Signing</title>
            <link>http://geekswithblogs.net/sdorman/archive/2008/02/29/code-signing.aspx</link>
            <description>&lt;p&gt;Ever since the .NET Framework was first release, Microsoft has always recommended that your code be signed. Windows Vista drives this point home even more with UAC and the Windows Error Reporting (WER) features, not to mention the fact that it's a requirement for Vista logo certification. John Robbins from Wintellect provides an excellent &lt;a href="http://www.wintellect.com/cs/blogs/jrobbins/archive/2007/12/21/code-signing-it-s-cheaper-and-easier-than-you-thought.aspx" target="_blank"&gt;explanation&lt;/a&gt; of how to sign your code. As it turns out, it's a lot easier than many of you may have thought.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120107"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120107" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/sdorman/aggbug/120107.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Scott Dorman</dc:creator>
            <guid>http://geekswithblogs.net/sdorman/archive/2008/02/29/code-signing.aspx</guid>
            <pubDate>Sat, 01 Mar 2008 02:59:10 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sdorman/comments/120107.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sdorman/archive/2008/02/29/code-signing.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/sdorman/comments/commentRss/120107.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/sdorman/services/trackbacks/120107.aspx</trackback:ping>
        </item>
    </channel>
</rss>