<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>ASP.NET</title>
        <link>http://geekswithblogs.net/TimH/category/2637.aspx</link>
        <description>ASP.NET</description>
        <language>en-NZ</language>
        <copyright>Tim Huffam</copyright>
        <managingEditor>timhuffam@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Turning on code coverage/instrumentation in a TFS Build</title>
            <link>http://geekswithblogs.net/TimH/archive/2009/06/16/turning-on-code-coverageinstrumentation-in-a-tfs-build.aspx</link>
            <description>&lt;p&gt;This requires a testrunconfig file that has been configured correctly.  To do this I did the following:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;In VS2008, right click on Solution Items folder and select Add - New Item... &lt;/li&gt;
    &lt;li&gt;Select Test Run Configuration and enter the name WithCodeCoverage.testrunconfig. &lt;/li&gt;
    &lt;li&gt;Open/edit this file in VS. &lt;/li&gt;
    &lt;li&gt;Select the 'Code Coverage' item on the left, then selected (checked) the assemblies I wanted to instrument &lt;/li&gt;
    &lt;li&gt;Click Apply to save these changes. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Note that you can select which is the active test run configuration from under the Test menu in VS2008. &lt;/p&gt;
&lt;p&gt;Now we need to update the TFS build...&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Open your TFS build file (eg TFSBuild.proj)&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;In the section starting with&lt;br /&gt;
    &lt;font face="Courier New"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;PropertyGroup&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;font face="Courier New"&gt; TEST ARGUMENTS&lt;/font&gt;...&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;
    Add the following line (after the comments and before the closing of PropertyGroup):&lt;br /&gt;
    &lt;font face="Courier New"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;RunConfigFile&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;Condition&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;"&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; '$(IsDesktopBuild)' != 'true' &lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;"&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;$(SolutionRoot)\DEV\Release1\Source\WithCodeCoverage.testrunconfig&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;RunConfigFile&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;
    (update accordingly to suit your build server paths). &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That's it.  Queue a build to test - you may need to verify your server build paths to get it working (I did).&lt;/p&gt;
&lt;p&gt;HTH&lt;br /&gt;
Tim&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132870"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132870" 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/TimH/aggbug/132870.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2009/06/16/turning-on-code-coverageinstrumentation-in-a-tfs-build.aspx</guid>
            <pubDate>Wed, 17 Jun 2009 04:32:14 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/132870.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2009/06/16/turning-on-code-coverageinstrumentation-in-a-tfs-build.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/132870.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/132870.aspx</trackback:ping>
        </item>
        <item>
            <title>How to turn on unit testing in your TFS build</title>
            <link>http://geekswithblogs.net/TimH/archive/2009/06/16/how-to-turn-on-unit-testing-in-your-tfs-build.aspx</link>
            <description>&lt;p&gt;The following will make your builds (running on a TFS Server) execute your unit tests after the build:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Open your build file (eg TFSBuild.proj).  VS2008 has a nice xml editor for this.&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Search for the RunTest node and change it from:&lt;br /&gt;
    &lt;font face="Courier New"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;RunTest&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;false&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;RunTest&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font face="Courier New"&gt;&amp;gt;&lt;/font&gt;&lt;br /&gt;
    &lt;/font&gt;&lt;/font&gt;to:&lt;br /&gt;
    &lt;font face="Courier New"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;RunTest&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;true&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;/&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;RunTest&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Look for a section that starts with:&lt;br /&gt;
    &lt;font face="Courier New"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;ItemGroup&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font face="Courier New" color="#0000ff" size="2"&gt;&amp;gt;&lt;br /&gt;
    &amp;lt;!--&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;font face="Courier New"&gt; TEST ARGUMENTS&lt;/font&gt; ...&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;
    and add nodes within this (after the comments and before the closing of the ItemGroup node) - one entry for each unit test assembly you have eg:&lt;br /&gt;
    &lt;font face="Courier New"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;TestContainer&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;&lt;font color="#ff0000" size="2"&gt;Include&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;=&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;"&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;$(OutDir)\My.App.UnitTests.dll&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;"&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt; /&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Thats it - check in this file and queue a build.&lt;/p&gt;
&lt;p&gt;An error I got while getting this working indicated that the MSTest.exe could not be found - this was because TFS Client had not been installed on the build server - once these were installed it worked fine.&lt;/p&gt;
&lt;p&gt;Something else you may want to do is ensure that a build is triggered every time someone checks in.  To do this, edit your build definition (right click on your build within Team Explorer and choose "Edit Build Definition...") - click on the 'Trigger' item in the list on the left and make sure the "Build each check-in (more builds)" item is checked.&lt;/p&gt;
&lt;p&gt;HTH&lt;br /&gt;
Tim&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132866"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132866" 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/TimH/aggbug/132866.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2009/06/16/how-to-turn-on-unit-testing-in-your-tfs-build.aspx</guid>
            <pubDate>Wed, 17 Jun 2009 03:54:27 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/132866.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2009/06/16/how-to-turn-on-unit-testing-in-your-tfs-build.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/132866.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/132866.aspx</trackback:ping>
        </item>
        <item>
            <title>How to unit test against resources (localization) values within Visual Studio 2008</title>
            <link>http://geekswithblogs.net/TimH/archive/2009/05/22/how-to-unit-test-against-resources-localization-values-within-visual.aspx</link>
            <description>&lt;p&gt;When unit testing you sometimes need to test that values are being set to the correct literal/constant value - and this value is often stored in a resources file.&lt;/p&gt;
&lt;p&gt;However, for some reason the VS2008 'Create Private Accessor' feature did not work for me for resources (maybe be cause they're all static properties and the generated _Accessor classes need to be instantiated).  So to make these resource available within the unit test project I simply made the Resources class public (by default it's internal).&lt;/p&gt;
&lt;p&gt;To do this:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Open the resource file (eg Resources.resx) using the Visual Studio resource editor tool (just double click on the .resx file).&lt;/li&gt;
    &lt;li&gt;At the top of the editor tab there is a drop down box labelled "Access Modifier" - change this from Internal to Public and save the file.&lt;/li&gt;
    &lt;li&gt;Rebuild the project.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Your resources will now be accessible in your unit tests.&lt;/p&gt;
&lt;p&gt;HTH&lt;br /&gt;
Tim&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132362"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132362" 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/TimH/aggbug/132362.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2009/05/22/how-to-unit-test-against-resources-localization-values-within-visual.aspx</guid>
            <pubDate>Fri, 22 May 2009 21:07:55 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/132362.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2009/05/22/how-to-unit-test-against-resources-localization-values-within-visual.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/132362.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/132362.aspx</trackback:ping>
        </item>
        <item>
            <title>Error: Failed to access IIS metabase. Hosting WCF Service in IIS</title>
            <link>http://geekswithblogs.net/TimH/archive/2009/05/14/error-failed-to-access-iis-metabase.-hosting-wcf-service-in.aspx</link>
            <description>&lt;p&gt;This error ("Failed to access IIS metabase") can occur when you try to access your WCF when you have added for hosting within IIS.&lt;/p&gt;
&lt;p&gt;To solve this problem do this:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Reregister ASP.NET for IIS:  Open an Visual Studio Command Prompt (or a regular command prompt and cd into the .Net dir - usually: &lt;font face="Arial"&gt;C:\WINNT\Microsoft.NET\Framework\v2.0.50727&lt;/font&gt;) then type:&lt;br /&gt;
       aspnet_regiis -i&lt;/li&gt;
    &lt;li&gt;When complete, from the same command prompt run: iisreset&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Verify your IIS virtual/app dir is setup correctly (uses .Net 2).  If you don't already have one...&lt;/p&gt;
&lt;p&gt;To Host a WCF Service within IIS:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Develop your service in IIS (I'm not going to tell you how to do that!) and build it.&lt;/li&gt;
    &lt;li&gt;Within your computer management/MMC console (compmgmt.msc), open the Internet Information Service node and right click on the site you want to use and select New - Virtual Directory...&lt;/li&gt;
    &lt;li&gt;Enter the name you want.&lt;/li&gt;
    &lt;li&gt;Point this to the directory you created your WCF service project in (the project root dir - not the bin dir).&lt;/li&gt;
    &lt;li&gt;Complete the wizard then back in the MMC window right click on your new virtual dir and select Properties.&lt;/li&gt;
    &lt;li&gt;On the ASP.NET tab make sure uses version 2.0.50727 (or whatever your v2 is).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To test:  within the MMC console - open your new virtual dir, right click on one of your services (eg MyService.svc) and select Browse.&lt;/p&gt;
&lt;p&gt;HTH&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132098"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=132098" 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/TimH/aggbug/132098.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2009/05/14/error-failed-to-access-iis-metabase.-hosting-wcf-service-in.aspx</guid>
            <pubDate>Thu, 14 May 2009 20:13:04 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/132098.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2009/05/14/error-failed-to-access-iis-metabase.-hosting-wcf-service-in.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/132098.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/132098.aspx</trackback:ping>
        </item>
        <item>
            <title>Script to remove unchanged files in TFS/VS2008</title>
            <link>http://geekswithblogs.net/TimH/archive/2009/01/22/script-to-remove-unchanged-files-in-tfsvs2008.aspx</link>
            <description>TFS has a wonderful feature whereby it marks files as changed, even though there are no changes.  These files show up in the Pending Changes window in Visual Studio (VS 2008). &lt;br /&gt;
&lt;br /&gt;
To work around this,  add the following external command to your VS tools:&lt;br /&gt;
&lt;ol&gt;
    &lt;li&gt;First you need to install &lt;a href="javascript:void(0);/*1232591142036*/"&gt;TFS Power Tools&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;In VS go into Tools - External Tools and click Add&lt;/li&gt;
    &lt;li&gt;Enter the following details:&lt;br /&gt;
    &lt;span style="font-weight: bold;"&gt;Title&lt;/span&gt;: Unchange&lt;br /&gt;
    &lt;span style="font-weight: bold;"&gt;Command&lt;/span&gt;: C:\Program Files\Microsoft Team Foundation Server 2008 Power Tools\tfpt.exe&lt;br /&gt;
    &lt;span style="font-weight: bold;"&gt;Arguments&lt;/span&gt;: uu /recursive /noget&lt;br /&gt;
    &lt;span style="font-weight: bold;"&gt;Initial Directory&lt;/span&gt;: $(SolutionDir)&lt;/li&gt;
    &lt;li&gt;And check 'Use Output Window'&lt;/li&gt;
    &lt;li&gt;Click Ok&lt;/li&gt;
&lt;/ol&gt;
That's it.  To test, view the Pending Changes window - usually after a 'Get Latest' is when it lists unmodified files as changed - then click Tools  - Unchange.&lt;br /&gt;
&lt;br /&gt;
Thanks to &lt;a href="javascript:void(0);/*1232591391656*/"&gt;Duncan Smith&lt;/a&gt; for this gem of info.&lt;br /&gt;
&lt;br /&gt;
The fact they created a tool for this makes you wonder!&lt;br /&gt;
&lt;br /&gt;
HTH&lt;br /&gt;
Tim&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=128877"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=128877" 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/TimH/aggbug/128877.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2009/01/22/script-to-remove-unchanged-files-in-tfsvs2008.aspx</guid>
            <pubDate>Thu, 22 Jan 2009 21:31:34 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/128877.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2009/01/22/script-to-remove-unchanged-files-in-tfsvs2008.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/128877.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/128877.aspx</trackback:ping>
        </item>
        <item>
            <title>How to move/drag objects in Silverlight (2.0)</title>
            <link>http://geekswithblogs.net/TimH/archive/2008/11/05/how-to-movedrag-objects-in-silverlight-2.0.aspx</link>
            <description>&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;font face="Arial"&gt;The following code shows you how you can make Silverlight controls/objects moveable by dragging them with the mouse.&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;font face="Arial"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;font face="Arial"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;font face="Arial" color="#000000" size="3"&gt;&lt;strong&gt;Page.cs:&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;UserControl&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; x&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;:&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;Class&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="MovingObjs.Page"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;   &lt;span style="COLOR: red"&gt; xmlns&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;   &lt;span style="COLOR: red"&gt; xmlns&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: red"&gt;x&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;   &lt;span style="COLOR: red"&gt; Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="400"&lt;/span&gt;&lt;span style="COLOR: red"&gt; Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="300"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;    &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;Canvas&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; x&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;:&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;Name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="LayoutRoot"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; Background&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="White"&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;        &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;Border&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; CornerRadius&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="10"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; x&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;:&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;Name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="brdMovable"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; BorderBrush&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="Black"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; BorderThickness&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="2"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; Background&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="AntiqueWhite"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; Canvas.Top&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="100"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; Canvas.Left&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="10"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; MouseLeftButtonDown&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="brdMovable_MouseLeftButtonDown"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; MouseLeftButtonUp&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="brdMovable_MouseLeftButtonUp"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; MouseMove&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="brdMovable_MouseMove"&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;            &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;Grid&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; x&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;:&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;Name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="grid1"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; Width&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="300"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; Margin&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="5" &amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;                &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;TextBlock&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; x&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;:&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;Name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="txtBlkTest"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt; Text&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;="Test"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;TextBlock&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;            &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;Grid&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;        &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;Border&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;    &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;Canvas&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'"&gt;UserControl&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;font face="Arial" color="#000000" size="3"&gt;&lt;strong&gt;Page.xaml.cs:&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;namespace&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; MovingObjs&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;    &lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;partial&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Page&lt;/span&gt; : &lt;span style="COLOR: #2b91af"&gt;UserControl&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;    {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        &lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;bool&lt;/span&gt; moving = &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        &lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;double&lt;/span&gt; offSetX;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        &lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;double&lt;/span&gt; offSetY;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        &lt;span style="COLOR: blue"&gt;public&lt;/span&gt; Page()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;            InitializeComponent();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        &lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; brdMovable_MouseLeftButtonDown(&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: #2b91af"&gt;MouseButtonEventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;            moving = &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;            &lt;span style="COLOR: #2b91af"&gt;Point&lt;/span&gt; offset = e.GetPosition(brdMovable);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;            offSetX = offset.X;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;            offSetY = offset.Y;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        &lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; brdMovable_MouseLeftButtonUp(&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: #2b91af"&gt;MouseButtonEventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;            moving = &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        &lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; brdMovable_MouseMove(&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: #2b91af"&gt;MouseEventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;            &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (moving)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;            {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;                &lt;span style="COLOR: #2b91af"&gt;Canvas&lt;/span&gt; parent = (&lt;span style="COLOR: #2b91af"&gt;Canvas&lt;/span&gt;)&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.brdMovable.Parent;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;                &lt;span style="COLOR: #2b91af"&gt;Point&lt;/span&gt; p = e.GetPosition(parent);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;                &lt;span style="COLOR: blue"&gt;double&lt;/span&gt; x = p.X - offSetX;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;                &lt;span style="COLOR: blue"&gt;double&lt;/span&gt; y = p.Y - offSetY;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;                txtBlkTest.Text = &lt;span style="COLOR: #a31515"&gt;"X: "&lt;/span&gt; + x.ToString() + &lt;span style="COLOR: #a31515"&gt;", Y: "&lt;/span&gt; + y.ToString();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;                &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.brdMovable.SetValue(&lt;span style="COLOR: #2b91af"&gt;Canvas&lt;/span&gt;.LeftProperty, x);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;                &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.brdMovable.SetValue(&lt;span style="COLOR: #2b91af"&gt;Canvas&lt;/span&gt;.TopProperty, y);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;            }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;        }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;    }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126621"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=126621" 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/TimH/aggbug/126621.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2008/11/05/how-to-movedrag-objects-in-silverlight-2.0.aspx</guid>
            <pubDate>Wed, 05 Nov 2008 18:24:43 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/126621.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2008/11/05/how-to-movedrag-objects-in-silverlight-2.0.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/126621.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/126621.aspx</trackback:ping>
        </item>
        <item>
            <title>How to remove TFS workspaces</title>
            <link>http://geekswithblogs.net/TimH/archive/2008/10/09/how-to-remove-tfs-workspaces.aspx</link>
            <description>&lt;div&gt;&lt;font face="Arial" size="2"&gt;&lt;span class="210411022-23082008"&gt;This will actually remove the your workspaces - unlike the VS/TFS Source Control Explorer which simply does not display them - duh!&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font face="Arial" size="2"&gt;&lt;span class="210411022-23082008"&gt;&lt;/span&gt;&lt;/font&gt; &lt;/div&gt;
&lt;div&gt;&lt;font face="Arial" size="2"&gt;&lt;span class="210411022-23082008"&gt;From the VS command prompt: &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;span class="210411022-23082008"&gt;  &lt;/span&gt;&lt;font color="#0000ff"&gt;tf workspaces /remove:*&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font face="Arial" size="2"&gt;&lt;/font&gt; &lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125718"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125718" 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/TimH/aggbug/125718.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2008/10/09/how-to-remove-tfs-workspaces.aspx</guid>
            <pubDate>Thu, 09 Oct 2008 14:10:29 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/125718.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2008/10/09/how-to-remove-tfs-workspaces.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/125718.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/125718.aspx</trackback:ping>
        </item>
        <item>
            <title>Firefox 3 ignores cache control http headers - security risk for online apps!</title>
            <link>http://geekswithblogs.net/TimH/archive/2008/09/26/firefox-3-ignores-cache-control-http-headers.aspx</link>
            <description>&lt;p&gt;If a user, using Firefox 3, signs out of a web site and does not close the browser, anyone else using that browser subsequently can view the content of pages loaded by the previous user (eg in an internet cafe, or any place where workstations are shared eg universities) - exposing private/confidential data.&lt;/p&gt;
&lt;div&gt;&lt;span class="813573621-25092008"&gt;This only affects HTTP post requests (not gets) and only Firefox version 3 - earlier versions (1.5, 2 etc), and IE, are not affected.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;&lt;span class="813573621-25092008"&gt;The main points are:&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;span class="813573621-25092008"&gt;This is definately a bug:  a violation of RFC 2616, section 14.9 that states "The Cache-Control general-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain".&lt;/span&gt; &lt;/li&gt;
    &lt;li&gt;&lt;span class="813573621-25092008"&gt;Some companies who deem this a significant hole in their security have chosen to block requests from Firefox 3 (eg they deem it their responsibility to secure their customers private and confidential data to the best of their ability).&lt;/span&gt; &lt;/li&gt;
    &lt;li&gt;&lt;span class="813573621-25092008"&gt;This bug has been registered with the Mozilla dev team, but currently (as of 26 Sept 2008) has a status of unconfirmed.&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;span class="813573621-25092008"&gt;
&lt;div&gt;&lt;span class="813573621-25092008"&gt;Related links:&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;span class="813573621-25092008"&gt;&lt;a href="http://forums.mozillazine.org/viewtopic.php?f=25&amp;amp;t=673135&amp;amp;st=0&amp;amp;sk=t&amp;amp;sd=a"&gt;http://forums.mozillazine.org/viewtopic.php?f=25&amp;amp;t=673135&amp;amp;st=0&amp;amp;sk=t&amp;amp;sd=a&lt;/a&gt; (one of the best discussions I've found on this - includes several other links)&lt;/span&gt; &lt;/li&gt;
    &lt;li&gt;&lt;span class="813573621-25092008"&gt;&lt;a href="http://www.freesoft.org/CIE/RFC/2068/164.htm"&gt;http://www.freesoft.org/CIE/RFC/2068/164.htm&lt;/a&gt; (RFC 2616, section 14.9 - regarding cache control)&lt;/span&gt; &lt;/li&gt;
    &lt;li&gt;&lt;span class="813573621-25092008"&gt;&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=441751"&gt;https://bugzilla.mozilla.org/show_bug.cgi?id=441751&lt;/a&gt; (the bug registered on Mozilla's bug tracking system)&lt;/span&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span class="813573621-25092008"&gt;Tim&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125468"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125468" 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/TimH/aggbug/125468.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2008/09/26/firefox-3-ignores-cache-control-http-headers.aspx</guid>
            <pubDate>Fri, 26 Sep 2008 20:17:40 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/125468.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2008/09/26/firefox-3-ignores-cache-control-http-headers.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/125468.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/125468.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET SQL Server error: The connection was not closed. The connection's current state is open</title>
            <link>http://geekswithblogs.net/TimH/archive/2008/09/09/asp.net-sql-server-error-the-connection-was-not-closed.-the.aspx</link>
            <description>&lt;p&gt;The following error occured when 2 requests hit an ASP.NET (2.0) web app (using SQL Server 2005) at the same time:&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" color="#0000ff"&gt;The connection was not closed. The connection's current state is open&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Normally this only occurs if you have a connection that is not being closed.  However in our case all connections where being closed using a &lt;font face="Courier New" color="#0000ff"&gt;try&lt;/font&gt;-&lt;font face="Courier New" color="#0000ff"&gt;finally&lt;/font&gt; block (personally I prefer using a &lt;font face="Courier New" color="#0000ff"&gt;using&lt;/font&gt; block).&lt;/p&gt;
&lt;p&gt;This error only occured when the 2 request were initiated from different machines.&lt;/p&gt;
&lt;p&gt;It turns out that the error occured because the same username was being used  for all requests (we were not interested in the username  in the app - and simply validated the request through a token and set the username to the same static string for all requests).  As soon as we made the username unique (by appending a guid to it) the error ceased to occur.&lt;/p&gt;
&lt;p&gt;This indicates that ADO.NET uses the username as part of it's connection pooling management. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;*** UPDATE 17 Nov 08 ***&lt;br /&gt;
&lt;/strong&gt;After more testing we proved this theory incorrect.  We found that the root cause of the original exception (connection state is open) was because we used a static member in one of our ORM classes - this held on to the connection, and it never got closed (hence the exception) - once we converted this to a non-static variable the problem disappeared.  However, adding the GUID to the ASP.NET username did have the above mentioned affect in several scenarios - which still leads me to believe the username has some relation/use in the connection pooling management (not sure why - as it's the process's identity that things run as - not the user's).&lt;/p&gt;
&lt;p&gt;HTH&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125020"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125020" 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/TimH/aggbug/125020.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2008/09/09/asp.net-sql-server-error-the-connection-was-not-closed.-the.aspx</guid>
            <pubDate>Tue, 09 Sep 2008 17:48:33 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/125020.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2008/09/09/asp.net-sql-server-error-the-connection-was-not-closed.-the.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/125020.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/125020.aspx</trackback:ping>
        </item>
        <item>
            <title>Task Oriented Programming</title>
            <link>http://geekswithblogs.net/TimH/archive/2008/09/09/task-oriented-programming.aspx</link>
            <description>&lt;p&gt;For some time I've been wondering if there's a better way to program business logic.  Years ago I used to write COBOL, then moved onto a 4GL, bla bla bla... and today I find myself well entrenched in OO with Microsoft's .Net.  Development times don't seem to be much better these days - and the complexity of things seems to have mushroomed.  &lt;/p&gt;
&lt;p&gt;We went from barely-a-3GL to 4GL back to 3GL plus an explosion of things you need to consider.  We started with procedural code then moved to OO and seem to have got stuck there.  But somehow I think we need to revise our use of OO.  Business logic is predominantly procedural code - even if written in OO; it starts, follows a process, performing stuff until finished eg Customer.UpdateCreditLimit()&lt;/p&gt;
&lt;p&gt;OO is really good for modelling things - as per the classic OO examples of a bicycle or car.  And thus they model business things quite well too - like an Invoice or a Customer.  &lt;/p&gt;
&lt;p&gt;However, I've found that the more object oriented the code gets - the less productive, maintainable and flexible it becomes.  Not saying leave OO - far from it - it's brilliant.  It's just that we need to learn when to say 'when'.   The use of patterns has helped a huge amount - but these can also caused similar problems - when being applied where they aren't really needed - resulting in overly complex software (read: inflexible and unmaintainable and unproductive).  It's a fine line - and it's not easy to get the balance.&lt;/p&gt;
&lt;p&gt;A major break through in this area is &lt;a href="http://msdn.microsoft.com/en-us/library/bb397926.aspx"&gt;LINQ&lt;/a&gt;.  This has meant we have less clutter in our apps catering for ORM (brilliant).  This has resulted in code very similar to the old 4GL days (essentially 4GLs were just SQL based code anyway) - where all you care/code about is the business logic - caring not a jot about how or where a Customer or Order got created - and in this age of SOA - that becomes more important (as a Customer could come from many different sources - local RDBMS, company ERP, external CRM etc).  I guess you could say LINQ allows you to focus your code to be more domain specific (not saying it's a DSL).&lt;/p&gt;
&lt;p&gt;I have been playing with workflows for donkeys of years and found that although the individual workflow systems themselves can range from very simple to incredibly complex - the individual tasks they perform need not be.   This had lead me to start thinking about applying this principle to code design at a reasonably low level....  what if we developed tasks as objects.  Each task has just one job (I've heard some people say this is how objects 'should' be coded anyway).  It has properties that can be get/set.  Keeping things dead simple, eg:&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt; &lt;font color="#0000ff" size="2"&gt;class&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New" color="#2b91af" size="2"&gt;AdderTask&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;{&lt;/font&gt;&lt;br /&gt;
    &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;Addend1 {&lt;/font&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;get&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;set&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;; }&lt;br /&gt;
&lt;/font&gt;    &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;Addend2 {&lt;/font&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;get&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;set&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;; }&lt;/font&gt;&lt;br /&gt;
    &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;Result {&lt;/font&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;get&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;set&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;; }&lt;/font&gt;&lt;br /&gt;
    &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;font color="#000000"&gt;&lt;font size="2"&gt; AdderTask(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; addend1, &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New" size="2"&gt; addend2)&lt;br /&gt;
    {&lt;br /&gt;
        &lt;/font&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&lt;font face="Courier New" size="2"&gt;Addend1 = addend1;&lt;br /&gt;
        &lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;Addend2 = addend2;&lt;br /&gt;
    }&lt;br /&gt;
&lt;/font&gt;    &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;AdderTask&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt; &lt;/font&gt;&lt;font face="Courier New" color="#000000"&gt;Execute()&lt;br /&gt;
    &lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;{&lt;br /&gt;
        Result = Addend1 + Addend2;&lt;br /&gt;
&lt;/font&gt;        &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;return&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#000000"&gt;;&lt;br /&gt;
&lt;/font&gt;  &lt;font color="#000000"&gt;  &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New" color="#000000" size="2"&gt;}&lt;br /&gt;
}&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;To run this you'd simply do this:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; &lt;font color="#000000"&gt;result =&lt;/font&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;AdderTask&lt;/font&gt;&lt;font color="#000000" size="2"&gt;(1, 2).Execute().Result;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000" size="2"&gt;Exposing the task's properties means you can build up get and set statements - and because the Execute method returns the task object itself you can easily use it in a single line as if it was a method on it's own - or retrieve it's property values after the Execute (these tasks would easily be adapted to work within a workflow system).&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000" size="2"&gt;This style lends itself to expanding; rather like building blocks, you can build large workflows out of these task oriented blocks.  The workflows themselves coded just like these tasks - whereby all the business logic resides within the Execute() method.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000" size="2"&gt;Adding LINQ to the mix takes this to the next level - allowing you to build software that is simple to develop and understand.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000" size="2"&gt;I've been building a sizable system using this technique and I'm finding that I'm converting code developed using standard OO practices over to this methodology as it makes code more easily reused - but most importantly: easier to read and maintain.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;In summary:&lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;font size="2"&gt;All input and output parameters should be implemented as properties (getter and setter accessors).&lt;/font&gt; &lt;/li&gt;
    &lt;li&gt;&lt;font size="2"&gt;Provide a constructor that accepts all required parameters. A default constructor (with no parameters) is optional (I've found I never need these - but if you were to use these tasks in a workflow system they may need this).&lt;/font&gt; &lt;/li&gt;
    &lt;li&gt;&lt;font size="2"&gt;Provide an Execute() method that takes no parameters and returns the object instance eg &lt;font face="Courier New"&gt;&lt;font color="#0000ff" size="2"&gt;return&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;/li&gt;
    &lt;li&gt;&lt;font size="2"&gt;The object should clean up after itself.  &lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;font size="2"&gt;Other notes:&lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;font size="2"&gt;Originally I created a similar type of class for workflows - but I found that these ended up being no different in concept to tasks.  Likewise I've found that some tasks needed to call other tasks - so I've ended up just implementing everything as tasks.  On reflection this is actually quite valid - because, as I found when building large orchestrations using Biztalk, workflows become atomic tasks themselves when used within the context of a large orchestration (which may run many workflows and external tasks) - and the orchestration, from a highlevel could also be considered an atomic task.&lt;/font&gt; &lt;/li&gt;
    &lt;li&gt;&lt;font size="2"&gt;I've found using System.Transactions.TransactionScope great for scoping transactions around many tasks when creating a macro task that runs many sub tasks.&lt;/font&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Suggestions/comments very welcome - I'd like others to expand or comment on this.&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000" size="2"&gt;Tim&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125008"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125008" 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/TimH/aggbug/125008.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2008/09/09/task-oriented-programming.aspx</guid>
            <pubDate>Tue, 09 Sep 2008 05:10:06 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/125008.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2008/09/09/task-oriented-programming.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/125008.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/125008.aspx</trackback:ping>
        </item>
    </channel>
</rss>