<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:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>What Was I Thinking?</title>
        <link>http://geekswithblogs.net/SoftwareDoneRight/Default.aspx</link>
        <description>Follies &amp; Foils of .NET Development</description>
        <language>en-US</language>
        <copyright>ChrisD</copyright>
        <managingEditor>chris@wtfsolutions.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>What Was I Thinking?</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/SoftwareDoneRight/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Iterating Static Fields / Properties</title>
            <category>VS2008 / .NET 3.5</category>
            <link>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/07/09/iterating-static-fields--properties.aspx</link>
            <description>&lt;p&gt;Often during development I end up with "Constants" classes, classes of constant or static values that I want design time Visual Studio intellisense support for, and run-time domain checking. &lt;/p&gt;  &lt;p&gt;Consider the following class:&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;public static class&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Constants     &lt;br /&gt;  &lt;/span&gt;{    &lt;br /&gt;       &lt;span style="color: blue"&gt;public static class&lt;/span&gt;&lt;span style="color: #2b91af"&gt;ClaimTypes     &lt;br /&gt;      &lt;/span&gt;{    &lt;br /&gt;           &lt;span style="color: blue"&gt;internal static string&lt;/span&gt;ClaimTypeNameSpace = &lt;span style="color: #a31515"&gt;"http://schemas.wtfsolutions.com/2008/07/claims/profile/"&lt;/span&gt;;    &lt;br /&gt;           &lt;span style="color: blue"&gt;public static string&lt;/span&gt;FirstName = ClaimTypeNameSpace + &lt;span style="color: #a31515"&gt;"firstname"&lt;/span&gt;;    &lt;br /&gt;           &lt;span style="color: blue"&gt;public static string&lt;/span&gt;LastName = ClaimTypeNameSpace + &lt;span style="color: #a31515"&gt;"lastname"&lt;/span&gt;;    &lt;br /&gt;           &lt;span style="color: blue"&gt;public static string&lt;/span&gt;DateOfBirth = ClaimTypeNameSpace + &lt;span style="color: #a31515"&gt;"dateofbirth"&lt;/span&gt;;    &lt;br /&gt;           &lt;span style="color: blue"&gt;public static string&lt;/span&gt;FavoriteColor = ClaimTypeNameSpace + &lt;span style="color: #a31515"&gt;"favoritecolor"&lt;/span&gt;;    &lt;br /&gt;       }    &lt;br /&gt;    &lt;br /&gt;   }&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;This class is handy at design time.  When I type "&lt;strong&gt;Constants.ClaimTypes."&lt;/strong&gt; up pops an intellisense list of the valid claim types for my application. &lt;/p&gt;  &lt;p&gt;The problem with this list is that you can't iterate through it at runtime, ensuring the value of a variable is in the valid ClaimType domain of values.  Ideally I'd like to be able to do this: &lt;font color="#ff0000"&gt;** THIS DOES NOT WORK ***&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;span style="color: blue"&gt;private bool &lt;/span&gt;validateClaimType(&lt;span style="color: blue"&gt;string &lt;/span&gt;claimType)      &lt;br /&gt;{      &lt;br /&gt;    &lt;span style="color: blue"&gt;return &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Constants&lt;/span&gt;.&lt;span style="color: #2b91af"&gt;ClaimTypes&lt;/span&gt;.Contains(claimType);      &lt;br /&gt;}      &lt;br /&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Fortunately, we can use reflection to build a runtime dictionary of the field name and field values&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;, &lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt; staticFieldsToList(&lt;span style="color: #2b91af"&gt;Type &lt;/span&gt;targetType)
{
    &lt;span style="color: blue"&gt;var &lt;/span&gt;list = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;, &lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;(&lt;span style="color: #2b91af"&gt;StringComparer&lt;/span&gt;.OrdinalIgnoreCase);
    &lt;span style="color: blue"&gt;var &lt;/span&gt;fields = targetType.GetFields(BindingFlags.Public | BindingFlags.Static);
    &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;field &lt;span style="color: blue"&gt;in &lt;/span&gt;fields)
        list.Add(field.Name, field.GetValue(&lt;span style="color: blue"&gt;null&lt;/span&gt;) &lt;span style="color: blue"&gt;as string&lt;/span&gt;);
    &lt;span style="color: blue"&gt;return &lt;/span&gt;list;
}&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;and validate our claim type as follows: &lt;font color="#ff0000"&gt;** THIS WORKS **&lt;/font&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private bool &lt;/span&gt;validateClaimType(&lt;span style="color: blue"&gt;string &lt;/span&gt;claimType)
{
    &lt;span style="color: blue"&gt;return &lt;/span&gt;staticFieldsToList(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Constants&lt;/span&gt;.&lt;span style="color: #2b91af"&gt;ClaimTypes&lt;/span&gt;)).ContainsValue(claimType);
}&lt;/pre&gt;

  &lt;p&gt;In my real application I store the dictionary to a static field to avoid multiple reflection-based calls, but for the purposes of demonstrating functionality, the above code reflects the static class each call. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt; The best of both worlds, design-time IDE support and run-time domain validation.  &lt;/p&gt;

&lt;p&gt;I love it when a plan comes together.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123702"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123702" 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/SoftwareDoneRight/aggbug/123702.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>ChrisD</dc:creator>
            <guid>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/07/09/iterating-static-fields--properties.aspx</guid>
            <pubDate>Thu, 10 Jul 2008 02:27:50 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/SoftwareDoneRight/comments/123702.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/07/09/iterating-static-fields--properties.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/SoftwareDoneRight/comments/commentRss/123702.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/SoftwareDoneRight/services/trackbacks/123702.aspx</trackback:ping>
        </item>
        <item>
            <title>Google Quick Search for 64 Bit Windows</title>
            <category>General Geekiness</category>
            <link>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/07/04/google-quick-search-for-64-bit-windows.aspx</link>
            <description>&lt;p&gt;I've been using Google Desktop Search for some time now.  Most of it however, I don't find useful.  I never search my desktop, and store my mail on a different server, so I miss out on a lot of the Google Desktop value proposition.  So why use it at all?  The answer is Google Quick Search.  &lt;/p&gt;  &lt;p&gt;Google Quick Search is the little dialog that pops up whenever you press Ctrl twice.  I enter a phrase and hit enter and the phrase is automatically sent to the Google search page, rendering the search results in my browser window.  Its just so darn handy.. Google is literally at my (pinky's) finger tips. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/SoftwareDoneRight/WindowsLiveWriter/GoogleQuickSearchfor64BitWindows_98BA/image_10.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="57" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/SoftwareDoneRight/WindowsLiveWriter/GoogleQuickSearchfor64BitWindows_98BA/image_thumb_4.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I got a new PC recently and installed 64 Bit Windows 2008 Server.  During my "setup and configuration" phase, I was shocked to find Google had no support for 64 bit Windows operating systems.  Apparently it was available at one time but got pulled because of performance and compatibilities issues.   Oh Google, why has thou forsaken me?&lt;/p&gt;  &lt;p&gt;Since I only really wanted the Quick Search functionality, I decided to write my own Google Quick Search clone.  Enter WTF Quick Search. &lt;/p&gt;  &lt;p&gt;After installation (it installs itself in the startup folder), pressing Ctrl twice invokes the Quick Search dialog, which looks *ahem* slightly familiar.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/SoftwareDoneRight/WindowsLiveWriter/GoogleQuickSearchfor64BitWindows_98BA/wtfQuickSearch_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="52" alt="wtfQuickSearch" src="http://geekswithblogs.net/images/geekswithblogs_net/SoftwareDoneRight/WindowsLiveWriter/GoogleQuickSearchfor64BitWindows_98BA/wtfQuickSearch_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Most of the original Google Quick Search functionality is replicated in the WTF Quick Search.  Since it doesn't leverage the Google Desktop engine, you can't search your local desktop, and support for Google Suggest is on the horizon, but not yet implemented.  Instead this version uses Auto-Complete to remember your previous search terms and offers them as suggestions as you type. &lt;/p&gt;  &lt;p&gt;There are a number of Hot keys available for targeted searches.  Pressing Enter searches the web, Ctrl+I performs an image search, Ctrl+N a news search.  You get the idea.  There is a full list of hot keys available in the Options page.&lt;/p&gt;  &lt;p&gt;If you like Google's Quick Search, and have either a 64 bit, or 32 bit version of windows, but don't want/need the overhead of local desktop searching, download &lt;a href="http://wtfsolutions.com/Documents/wtfGoogleQuickSearchSetup.msi_"&gt;WTF's Quick Search&lt;/a&gt;. (you'll need to rename the .msi_ file extension to .msi before executing it). &lt;/p&gt;  &lt;p&gt;As always, I welcome your feedback and suggestions. &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;July 5, 2008 - Update:&lt;/strong&gt; I've released an &lt;a href="http://wtfsolutions.com/Documents/wtfGoogleQuickSearchSetup.msi_"&gt;new version&lt;/a&gt;.  This version fixes a bug with the Search Mode option (web vs program files), adds an Icon to the system tray which lets you show/hide the dialog and exit the application.  I've also added multiple monitor support, the dialog will pop up on the monitor that currently houses the mouse pointer.  Want it to do something else?  something better?  Let me know.  I'm always open to your feedback. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;July 22, 2008 - Update: &lt;/strong&gt;A &lt;a href="http://wtfsolutions.com/Documents/wtfGoogleQuickSearchSetup.msi_"&gt;new version&lt;/a&gt; is available that adds hot key support for searching Google Finance (Ctrl+F)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;July 29, 2008 - Update:&lt;/strong&gt; Don't like the Control+Control hotkey?  Define your own.  Video Card doesn't support transparency?  Try the "basic" interface.  Lookup MLS Listings by MLS number with customized MLS market codes. &lt;a href="http://wtfsolutions.com/Documents/wtfGoogleQuickSearchSetup.msi_"&gt;Download it here.&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123587"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123587" 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/SoftwareDoneRight/aggbug/123587.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>ChrisD</dc:creator>
            <guid>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/07/04/google-quick-search-for-64-bit-windows.aspx</guid>
            <pubDate>Fri, 04 Jul 2008 18:51:26 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/SoftwareDoneRight/comments/123587.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/07/04/google-quick-search-for-64-bit-windows.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/SoftwareDoneRight/comments/commentRss/123587.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/SoftwareDoneRight/services/trackbacks/123587.aspx</trackback:ping>
        </item>
        <item>
            <title>Clean Up WCF Clients : The Right Way</title>
            <category>VS2008 / .NET 3.5</category>
            <link>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/05/23/clean-up-wcf-clients--the-right-way.aspx</link>
            <description>&lt;p&gt;As I've done more and more WCF work recently, I've noticed an intermittent problem running my unit tests. &lt;/p&gt; &lt;p&gt;The host seemingly hangs for no obvious reason.  Eventually the connection times out and produces the following in the service log:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#ff0000"&gt;System.ServiceModel.CommunicationObjectAbortedException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Stopping the host and client and re-running the test allows it to pass without issue.  &lt;/p&gt; &lt;p&gt;The problem is related to the way I managed my WCF channels and client proxies.  In my code I make use of the ChannelFactory&amp;lt;T&amp;gt; object to create my wcf channels dynamically from my configuration information, like the following:&lt;/p&gt; &lt;p&gt; &lt;/p&gt;&lt;pre class="csharpcode"&gt;       &lt;span class="preproc"&gt;#region&lt;/span&gt; IdentityService Proxy
        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; IIdentityService _identitySvc;
        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; IIdentityService identitySvc
        {
            get
            {
                &lt;span class="kwrd"&gt;if&lt;/span&gt; (_identitySvc == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
                {
                    var factory = &lt;span class="kwrd"&gt;new&lt;/span&gt; ChannelFactory&amp;lt;IIdentityService&amp;gt;(&lt;span class="str"&gt;"IdentityService"&lt;/span&gt;);
                    _identitySvc = factory.CreateChannel();
                }
                &lt;span class="kwrd"&gt;return&lt;/span&gt; _identitySvc;
            }

        }
        &lt;span class="preproc"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;&lt;pre class="csharpcode"&gt;&lt;span class="preproc"&gt;&lt;/span&gt; &lt;/pre&gt;
&lt;p&gt;The client proxy produced implements the typed interface "IIdentityService" in the above example.  It natively supports no operations for channel management and cleanup.  However, failing to clean up the client proxy may cause channel timeouts and resource blocking on the server. So channel cleanup is important, but if its not implemented in the client proxy, how do you manage it?&lt;/p&gt;
&lt;p&gt;The secret lies in the casting.  The transparent proxy produced implements a number of useful interfaces.  For our purposes we care about IDisposable and IClientChannel. When we're done with the proxy,  we must close the channel and dispose of it.  I've seen some examples like this:&lt;/p&gt;
&lt;blockquote&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; (IClientChannel client = (IClientChannel)channelFactory.CreateChannel())
{
    IIdentityService proxy = (IIdentityService)client;
}&lt;/pre&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;This is Bad.&lt;/font&gt;&lt;/strong&gt;  Yes, you are disposing of the channel resource, but you haven't closed the wcf channel, you've only disposed of your handle to it.  You must explicitly call close then dispose on the proxy like so:&lt;/p&gt;&lt;pre class="csharpcode"&gt;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (_identitySvc != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
             {
                 ((IClientChannel)_identitySvc).Close();
                 ((IDisposable)_identitySvc).Dispose();
                 _identitySvc = &lt;span class="kwrd"&gt;null&lt;/span&gt;;
             }&lt;/pre&gt;&lt;pre class="csharpcode"&gt; &lt;/pre&gt;
&lt;p&gt;Optionally, since IClientChannel implements IDisposable, you could call ((IClientChannel) proxy).Dispose().  If you prefer, and your design allows, you can still use the using statement, just be sure to add try/catch blocks and call the close() method on the casted proxy before the closing brace. I tend to have static references to my proxy classes so I have to explicitly call close() and dispose() when I complete my WCF operation.&lt;/p&gt;
&lt;p&gt;Now that I'm properly cleaning up my proxies, my WCF services run all my tests without hanging.&lt;/p&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
]]&gt;&lt;/style&gt;

&lt;style type="text/css"&gt;&lt;![CDATA[csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
]]&gt;&lt;/style&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122354"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122354" 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/SoftwareDoneRight/aggbug/122354.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>ChrisD</dc:creator>
            <guid>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/05/23/clean-up-wcf-clients--the-right-way.aspx</guid>
            <pubDate>Fri, 23 May 2008 21:12:25 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/SoftwareDoneRight/comments/122354.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/05/23/clean-up-wcf-clients--the-right-way.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/SoftwareDoneRight/comments/commentRss/122354.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/SoftwareDoneRight/services/trackbacks/122354.aspx</trackback:ping>
        </item>
        <item>
            <title>Call For Help - Thunderbird resets my sort order</title>
            <category>General Geekiness</category>
            <link>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/05/13/call-for-help---thunderbird-resets-my-sort-order.aspx</link>
            <description>&lt;p&gt;I've been using the Thunderbird mail client for a while now, and overall I like it.  I've got a number of add-ons that let me download my web mail from Yahoo, GMail, Hotmail and the like. &lt;/p&gt;  &lt;p&gt;I've got all my email accounts available in a single client application.  So far so good. &lt;/p&gt;  &lt;p&gt;I do have a pet peeve however, maybe its a bug, maybe not.  It sure feels like a bug.  I did some googling but found no one else reporting this behavior, so maybe its my configuration.  But I found no configuration setting to support it, so if its not a program bug, its at least (in my opinion) a usability bug. &lt;/p&gt;  &lt;p&gt;When I view my inbox for an email account, I like it sorted by Date descending, so my latest mail is at the bottom of the list.  Its easy enough to sort it, just click on the date column header in the list view.   The problem however, is that the setting doesn't seem to stick.  For some reason, its always sorted by sender. &lt;/p&gt;  &lt;p&gt;If I sort my inbox view for email account A to Date, then I click on the inbox view for email Account B, and click back on the inbox view for email Account A, my previously specified sort order of date is not persisted, and the view is once again sorted by sender. &lt;/p&gt;  &lt;p&gt;Has anyone experienced this?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;  As I was writing this I was playing more with the Thunderbird UI, following along with my post to ensure I hadn't missed some salient point or user operation.  Suddenly, much to my surprise as I clicked from account to account, the sort order preference was getting preserved. The bug has mysteriously vanished.  Its like taking your car to the mechanic.  When its at the repair shop, it refuses to  act up.  &lt;/p&gt;  &lt;p&gt;If I knew all I had to do was write a blog entry about it, I could have had this fixed weeks ago &amp;lt;g&amp;gt;.&lt;/p&gt;  &lt;p&gt;I'll post another update should the bad behavior return.  I've also configured my client to show a View dropdown in the menu bar (I think this was an add-on).  I suspect this may have something to do with my sort order problem, but can't verify it until it starts acting up again. &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122097"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122097" 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/SoftwareDoneRight/aggbug/122097.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>ChrisD</dc:creator>
            <guid>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/05/13/call-for-help---thunderbird-resets-my-sort-order.aspx</guid>
            <pubDate>Tue, 13 May 2008 04:03:11 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/SoftwareDoneRight/comments/122097.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/05/13/call-for-help---thunderbird-resets-my-sort-order.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/SoftwareDoneRight/comments/commentRss/122097.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/SoftwareDoneRight/services/trackbacks/122097.aspx</trackback:ping>
        </item>
        <item>
            <title>Developing Windows Services</title>
            <category>VS2008 / .NET 3.5</category>
            <link>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/05/10/developing-windows-services.aspx</link>
            <description>&lt;p&gt;I've been developing and debugging a windows service for my current project. Working with a Windows service is very much like working with a console app, with the startup and shutdown logic separated into the servicebase's start and stop methods. &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;u&gt;Debugging a Windows Service&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;Unlike a console app, however Visual studio can't run a windows service and automatically attach the debugger (no Run-with-Debugger (F5) support).  Not to fear, its easily enough to attach the debugger to the windows service.  In my case, my service was starting and stopping right away, with no opportunity to attach the visual studio debugger to the running service.  Instead I added this handy dandy line of code to the constructor of the service class:&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;pre class="code"&gt;            &lt;span style="color: blue"&gt;#if &lt;/span&gt;DEBUG
             Debugger.Launch(); 
            &lt;span style="color: blue"&gt;#endif 
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;when the service starts, Windows prompts you to attach a debugger. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/SoftwareDoneRight/WindowsLiveWriter/DevelopingWindowsServices_A343/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="244" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/SoftwareDoneRight/WindowsLiveWriter/DevelopingWindowsServices_A343/image_thumb.png" width="226" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Select the debugger of choice and step through your windows service. &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;u&gt;Removing and Reinstalling a Windows Service&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;I ran into a problem attempting to uninstall  and reinstall my windows service.  I was able to delete the service fine, but when I attempted to reinstall the windows service I received a "The Specified Service has been marked for deletion" exception.&lt;/p&gt;

&lt;p&gt;Microsoft recommends rebooting to solve this problem; a solution that is not very conducive to a development cycle.  Fortunately I stumbled upon a easier solution. &lt;/p&gt;

&lt;p&gt;It seems that when the windows service list is visible (Start-&amp;gt;Control Panel-&amp;gt;Administrative -&amp;gt; Services), the list of windows services is cached and locked resulting in the "The Specified Service has been marked for deletion" exception.  The fix, &lt;strong&gt;close the services dialog.&lt;/strong&gt;  With the dialog closed, I was able to re-install the windows service without issue. &lt;/p&gt;

&lt;p&gt;I've switched my process to starting and stopping the service using Net Start/ Net Stop batch files.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122039"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122039" 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/SoftwareDoneRight/aggbug/122039.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>ChrisD</dc:creator>
            <guid>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/05/10/developing-windows-services.aspx</guid>
            <pubDate>Sat, 10 May 2008 15:48:56 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/SoftwareDoneRight/comments/122039.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/05/10/developing-windows-services.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/SoftwareDoneRight/comments/commentRss/122039.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/SoftwareDoneRight/services/trackbacks/122039.aspx</trackback:ping>
        </item>
        <item>
            <title>QuickTip: Case Insensitive Dictionaries</title>
            <category>VS2008 / .NET 3.5</category>
            <link>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/04/30/quicktip-case-insensitive-dictionaries.aspx</link>
            <description>&lt;p&gt;I've often thought about making my own implementation of a Dictionary&amp;lt;K,V&amp;gt; where the key values are case insensitive.&lt;/p&gt;  &lt;p&gt;Its been one of those things on my ever-growing to-do list. I usually end up casting the key values to all uppercase and try to encapsulate all my calls the the dictionary with my own logic that performs the case conversion.  A case insensitive dictionary would avoid all that nastiness. &lt;/p&gt;  &lt;p&gt;Sometimes it's helpful to read the tooltip overloads. As I coded a new dictionary instance today, I stumbled upon the &lt;/p&gt;  &lt;p&gt;&lt;font color="#000080"&gt;Dictionary&amp;lt;(Of &amp;lt;(TKey, TValue&amp;gt;)&amp;gt;) Constructor (IEqualityComparer&amp;lt;(Of &amp;lt;(TKey&amp;gt;)&amp;gt;))&lt;/font&gt; overload.   &lt;/p&gt;  &lt;p&gt;Apparently I can pass my own equality comparer into the constructor which tells the dictionary how to compare key values.   Could it really be that easy?&lt;/p&gt;  &lt;p&gt;Yep, it exactly that easy.  To make my dictionary&amp;lt;string,string&amp;gt; use case insensitive keys, declare the dictionary as follows:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font color="#000080"&gt;Dictionary&amp;lt;string, string&amp;gt; argList = new Dictionary&amp;lt;string, string&amp;gt;(StringComparer.CurrentCultureIgnoreCase);&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now  args["Test"] and args["TEST"] return the same item from my dictionary.&lt;/p&gt;  &lt;p&gt;I love it when I can mark things done on my to-do list without actually having to do any work. &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121790"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121790" 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/SoftwareDoneRight/aggbug/121790.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>ChrisD</dc:creator>
            <guid>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/04/30/quicktip-case-insensitive-dictionaries.aspx</guid>
            <pubDate>Wed, 30 Apr 2008 19:28:01 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/SoftwareDoneRight/comments/121790.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/04/30/quicktip-case-insensitive-dictionaries.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/SoftwareDoneRight/comments/commentRss/121790.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/SoftwareDoneRight/services/trackbacks/121790.aspx</trackback:ping>
        </item>
        <item>
            <title>QuickTip: Debugging VBS Files with CScript.exe and Visual Studio</title>
            <category>General Geekiness</category>
            <category>VS2008 / .NET 3.5</category>
            <link>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/04/14/quicktip-debugging-vbs-files-with-cscript.exe-and-visual-studio.aspx</link>
            <description>&lt;p&gt;This is another one of those "Posted here for &lt;strong&gt;MY&lt;/strong&gt; convenience" tips.&lt;/p&gt;  &lt;p&gt;You can use the Visual Studio Debugger to debug a .vbs (vbscript) file executed with cScript.exe by using the //X flag at the command line.   &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;To debug MyTest.vbs &lt;/p&gt;    &lt;p&gt;&lt;font color="#000080"&gt;cscript.exe MyTest.vbs //X&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;The //X will set a breakpoint and invoke the "select a debugger"  dialog where you can choose Visual Studio and step into your vbs code.  I haven't found a way to directly edit from the debugger however, so I end up having to debug, break execution, fix my bug and restart the vbs script file again to see my changes. &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121228"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121228" 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/SoftwareDoneRight/aggbug/121228.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>ChrisD</dc:creator>
            <guid>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/04/14/quicktip-debugging-vbs-files-with-cscript.exe-and-visual-studio.aspx</guid>
            <pubDate>Mon, 14 Apr 2008 15:26:15 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/SoftwareDoneRight/comments/121228.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/04/14/quicktip-debugging-vbs-files-with-cscript.exe-and-visual-studio.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/SoftwareDoneRight/comments/commentRss/121228.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/SoftwareDoneRight/services/trackbacks/121228.aspx</trackback:ping>
        </item>
        <item>
            <title>QuickTip: Performing work on a new thread using anonymous delegates</title>
            <category>VS2008 / .NET 3.5</category>
            <link>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/04/07/quicktip-performing-work-on-a-new-thread-using-anonymous-delegates.aspx</link>
            <description>&lt;p&gt;I know this is available other places on the web, but I'm posting it here because I often have to search for it.  This tip is more for my benefit than others :)&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;class&lt;/span&gt; Program
{
   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main()
   {
      Thread t = &lt;span class="kwrd"&gt;new&lt;/span&gt; Thread(&lt;span class="kwrd"&gt;delegate&lt;/span&gt;() { 
         SayName(&lt;span class="str"&gt;"Lou"&lt;/span&gt;,&lt;span class="str"&gt;"Costello"&lt;/span&gt;);
         });
      t.Start();
   }

   &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SayName(&lt;span class="kwrd"&gt;string&lt;/span&gt; firstName, &lt;span class="kwrd"&gt;string&lt;/span&gt; lastName)
  {
        Console.WriteLine(firstName + &lt;span class="str"&gt;" "&lt;/span&gt; + lastName);
  }
}&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121108"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=121108" 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/SoftwareDoneRight/aggbug/121108.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>ChrisD</dc:creator>
            <guid>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/04/07/quicktip-performing-work-on-a-new-thread-using-anonymous-delegates.aspx</guid>
            <pubDate>Tue, 08 Apr 2008 00:39:33 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/SoftwareDoneRight/comments/121108.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/04/07/quicktip-performing-work-on-a-new-thread-using-anonymous-delegates.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/SoftwareDoneRight/comments/commentRss/121108.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/SoftwareDoneRight/services/trackbacks/121108.aspx</trackback:ping>
        </item>
        <item>
            <title>QuickTip: Turn off CSS Validation Errors</title>
            <category>VS2008 / .NET 3.5</category>
            <link>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/03/17/quicktip-turn-off-css-validation-errors.aspx</link>
            <description>&lt;p&gt;I'm working on a prototype of a Single Sign On (SSO) solution for a web portal using Windows Cardspace as the authentication mechanism.  This means I've spent my weekend  developing web sites which may explain my foul mood. &lt;/p&gt;  &lt;p&gt;I was applying some color attributes to some of my UI controls which rendered fine, but generated compiler errors because they were failing CSS Validation.  Since it renders without issue (even between browsers), I'm not sure why its an error at all.  In any event these errors were preventing me from continuing with my SSO server work.  Fortunately we can specify how to treat CSS validation errors during a build in visual studio. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;1. Go to Tools -&amp;gt; Options -&amp;gt; Text Editor -&amp;gt; HTML -&amp;gt; Validation &lt;/p&gt;    &lt;p&gt;2. Uncheck the Show Error option&lt;/p&gt;    &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/SoftwareDoneRight/WindowsLiveWriter/QuickTipTurnoffCSSValidationErrors_B794/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="213" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/SoftwareDoneRight/WindowsLiveWriter/QuickTipTurnoffCSSValidationErrors_B794/image_thumb.png" width="373" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;    &lt;p&gt;3. Click OK&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120599"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120599" 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/SoftwareDoneRight/aggbug/120599.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>ChrisD</dc:creator>
            <guid>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/03/17/quicktip-turn-off-css-validation-errors.aspx</guid>
            <pubDate>Mon, 17 Mar 2008 21:03:07 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/SoftwareDoneRight/comments/120599.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/03/17/quicktip-turn-off-css-validation-errors.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/SoftwareDoneRight/comments/commentRss/120599.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/SoftwareDoneRight/services/trackbacks/120599.aspx</trackback:ping>
        </item>
        <item>
            <title>QuickTip:  Working with T-SQL Identities</title>
            <category>SQL</category>
            <link>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/03/08/quicktip--working-with-t-sql-identities.aspx</link>
            <description>&lt;p&gt;I recently had to write a data migration script from one SQL Server DB to another one.  I could have used SSIS, but it would have required a learning curve that our timeframe didn't permit.  A few hours later I had a functioning script that moved over most of the useful data (2 days later I discovered some more data that had to be migrated, but that's a separate issue). &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;In developing the migration script I had to deal with a series of key pool tables, each with their own identity columns for key generation.  My script needed to manipulate these tables and identity values which meant twittering the identity related triggers. &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Here's 3 quick commands I discovered useful:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;u&gt;To Disable Identity Key Value Generation&lt;/u&gt;&lt;/p&gt;    &lt;p&gt;When the identity generation is disabled, you must manually insert key values for the identity column.  Note:  Sql will not ensure your manually entered values are unique.  This can be a pro or con depending on your situation. &lt;/p&gt;    &lt;p&gt;&lt;font color="#000080"&gt;                            SET IDENTITY_INSERT [&lt;em&gt;TableName&lt;/em&gt;] ON &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;It seems counter-intuitive to me to disable the identity trigger by turning something ON, but there you go. &lt;/p&gt;    &lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;    &lt;p&gt;&lt;u&gt;To Restore Identity Key Value Generation&lt;/u&gt;&lt;/p&gt;    &lt;p&gt;&lt;font color="#004080"&gt;                           SET IDENTITY_INSERT [&lt;em&gt;TableName&lt;/em&gt;] OFF&lt;/font&gt; &lt;/p&gt;    &lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;    &lt;p&gt;&lt;u&gt;To Reset the Seed Value of an Identity Column&lt;/u&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;                           &lt;font color="#000080"&gt;dbcc checkident ('[&lt;em&gt;TableName&lt;/em&gt;]' , reseed, N&lt;em&gt;ewSeedValue&lt;/em&gt;)      &lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120387"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=120387" 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/SoftwareDoneRight/aggbug/120387.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>ChrisD</dc:creator>
            <guid>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/03/08/quicktip--working-with-t-sql-identities.aspx</guid>
            <pubDate>Sun, 09 Mar 2008 01:48:04 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/SoftwareDoneRight/comments/120387.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/SoftwareDoneRight/archive/2008/03/08/quicktip--working-with-t-sql-identities.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/SoftwareDoneRight/comments/commentRss/120387.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/SoftwareDoneRight/services/trackbacks/120387.aspx</trackback:ping>
        </item>
    </channel>
</rss>