<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>How to change the endpoint url of services that Silverlight clients use.</title>
            <link>http://geekswithblogs.net/TimH/archive/2012/01/08/how-to-change-the-endpoint-url-of-services-that-silverlight.aspx</link>
            <description>&lt;p&gt;If your Silverlight app references services, the endpoints to these services are stored within a config file within the xap bundle - which is usually deployed as .xap file within the ClientBin dir of your web app.&lt;/p&gt;
&lt;p&gt;To change the end point urls:&lt;br /&gt;1) Rename the xap file (eg within E:\Demos\MySilverlightApp.Web\ClientBin) to .zip.  &lt;br /&gt;2) Unzip it &lt;br /&gt;3) Edit the ServiceReferences.ClientConfig file (to update the endpoint url) and save it.&lt;br /&gt;4) Recreate the zip file&lt;br /&gt;5) Rename the .zip file as .xap&lt;/p&gt;
&lt;p&gt;That's it.&lt;/p&gt; &lt;img src="http://geekswithblogs.net/TimH/aggbug/148286.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2012/01/08/how-to-change-the-endpoint-url-of-services-that-silverlight.aspx</guid>
            <pubDate>Mon, 09 Jan 2012 02:17:26 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/148286.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2012/01/08/how-to-change-the-endpoint-url-of-services-that-silverlight.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/148286.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/148286.aspx</trackback:ping>
        </item>
        <item>
            <title>TFS 2008 error: MSB4131: The "Reason" parameter is not supported by the "GetBuildProperties" task.</title>
            <link>http://geekswithblogs.net/TimH/archive/2011/02/03/tfs-2008-error-msb4131-the-reason-parameter-is-not-supported.aspx</link>
            <description>&lt;p&gt;This error occured on our TFS2008 (RTM) build server after installing VS2010.&lt;/p&gt;
&lt;p&gt;This is caused because VS2010 updates the MSBuild targets file Microsoft.TeamFoundation.Build.targets but not the &lt;span class="Apple-style-span" style="word-spacing: 0px; font: 16px 'Times New Roman'; text-transform: none; color: rgb(0,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; webkit-border-horizontal-spacing: 0px; webkit-border-vertical-spacing: 0px; webkit-text-decorations-in-effect: none; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; color: rgb(51,51,51); line-height: 16px; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; text-align: left"&gt;Microsoft.TeamFoundation.Build.Tasks.dll file (which preforms the tasks mentioned in the targets file).&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="Apple-style-span" style="word-spacing: 0px; font: 16px 'Times New Roman'; text-transform: none; color: rgb(0,0,0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate; orphans: 2; widows: 2; webkit-border-horizontal-spacing: 0px; webkit-border-vertical-spacing: 0px; webkit-text-decorations-in-effect: none; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; color: rgb(51,51,51); line-height: 16px; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; text-align: left"&gt;To resolve you need to update TFS (build) server with SP1.  See &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/f370c977-d455-4263-a054-f556352f954a"&gt;this article&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;HTH&lt;br /&gt;
Tim&lt;/p&gt; &lt;img src="http://geekswithblogs.net/TimH/aggbug/143784.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2011/02/03/tfs-2008-error-msb4131-the-reason-parameter-is-not-supported.aspx</guid>
            <pubDate>Thu, 03 Feb 2011 23:22:32 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/143784.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2011/02/03/tfs-2008-error-msb4131-the-reason-parameter-is-not-supported.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/143784.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/143784.aspx</trackback:ping>
        </item>
        <item>
            <title>Error MSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the &lt;Import&gt; declaration is correct, and that the file exists on disk</title>
            <link>http://geekswithblogs.net/TimH/archive/2010/12/08/tset.aspx</link>
            <description>&lt;p&gt;This error occurred on our TFS2008 build server which we had upgraded to cater for VS2010 projects (by installing VS2010 on the build server - see &lt;a href="http://www.richard-banks.org/2009/11/how-to-build-vs2010-solutions-using.html"&gt;this article&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Error MSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the &amp;lt;Import&amp;gt; declaration is correct, and that the file exists on disk.&lt;/p&gt;
&lt;p&gt;However - although we had installed VS2010 on the build server - we had not installed the web development components (Visual Web Developer) - this is what caused the error.&lt;/p&gt;
&lt;p&gt;To fix - simply add the web development components:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Go into Control Panel - Add or Remove Programs&lt;/li&gt;
    &lt;li&gt;Select Microsoft Visual Studio 2010, and click on Change/Remove&lt;/li&gt;
    &lt;li&gt;In the VS Maintenance Mode screens, select Add or Remove Features&lt;/li&gt;
    &lt;li&gt;In the Setup - Options page make sure 'Visual Web Developer' is checked.&lt;/li&gt;
    &lt;li&gt;Click on Update.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;You shouldn't need to restart your build service.&lt;/p&gt;
&lt;p&gt;HTH&lt;br /&gt;
Tim&lt;br /&gt;
 &lt;/p&gt; &lt;img src="http://geekswithblogs.net/TimH/aggbug/143055.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2010/12/08/tset.aspx</guid>
            <pubDate>Wed, 08 Dec 2010 19:46:27 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/143055.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2010/12/08/tset.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/143055.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/143055.aspx</trackback:ping>
        </item>
        <item>
            <title>Creating mulitple TFS Build services on the same server - one for VS2008 projects and one for VS2010 projects</title>
            <link>http://geekswithblogs.net/TimH/archive/2010/12/01/creating-mulitple-tfs-build-services-on-the-same-server.aspx</link>
            <description>&lt;p&gt;This is for TFS2008.&lt;/p&gt;
&lt;p&gt;This is based mainly on this article: &lt;a href="http://blogs.msdn.com/b/jpricket/archive/2007/08/03/tfs-2008-running-two-build-agents-on-the-same-machine.aspx"&gt;http://blogs.msdn.com/b/jpricket/archive/2007/08/03/tfs-2008-running-two-build-agents-on-the-same-machine.aspx&lt;/a&gt;&lt;br /&gt;
But also had input from these:&lt;br /&gt;
&lt;a href="http://www.woodwardweb.com/vsts/000398.html"&gt;http://www.woodwardweb.com/vsts/000398.html&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://blogs.msdn.com/b/buckh/archive/2007/08/14/tfs-2008-a-basic-guide-to-team-build-2008.aspx"&gt;http://blogs.msdn.com/b/buckh/archive/2007/08/14/tfs-2008-a-basic-guide-to-team-build-2008.aspx&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://blogs.msdn.com/b/jimlamb/archive/2010/04/13/configuring-multiple-tfs-build-services-on-one-machine.aspx"&gt;http://blogs.msdn.com/b/jimlamb/archive/2010/04/13/configuring-multiple-tfs-build-services-on-one-machine.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Also the following article discussing upgrading a TFS2008 build server to cater for VS2010 projects: &lt;a href="http://www.richard-banks.org/2009/11/how-to-build-vs2010-solutions-using.html"&gt;http://www.richard-banks.org/2009/11/how-to-build-vs2010-solutions-using.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Scenario:  &lt;br /&gt;
---------&lt;br /&gt;
We want to use the existing build service the way it is - for VS2008 projects.&lt;br /&gt;
We will create a new build service, on the same machine but using another port -  for building VS2010/.Net 4.0 projects. &lt;br /&gt;
**For this we must have first installed VS2010 on the build server! (see article mentioned above).&lt;/p&gt;
&lt;p&gt;The reason we're creating another service is that we found certain VS2008 projects would not build using MSBuild 4.0 (intended for VS2010 - but supposedly catering also for VS2008).  The main problem area was unit tests and the private accessor's VS generates (to provide access to private/internal members of a class being tested).  The following link provides a work around, but we found this just opened up more problems - and in the end decided that the multi-service solution would get us up and running quickest: &lt;a href="http://blogs.msdn.com/b/adamroot/archive/2009/12/10/building-vs-2008-unit-test-projects-in-msbuild-4-0-beta-2.aspx"&gt;http://blogs.msdn.com/b/adamroot/archive/2009/12/10/building-vs-2008-unit-test-projects-in-msbuild-4-0-beta-2.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;span style="font-size: small"&gt;&lt;span style="font-family: Courier New"&gt;&lt;tt&gt;To create the 2nd build service (VS2010/.Net 4.0 projects):&lt;br /&gt;
-----------------------------------------------------------&lt;br /&gt;
1) Copy build service executable and config file (tfsbuildservice.exe &amp;amp; tfsbuildservice.exe.config) giving them another name &lt;br /&gt;
   (eg tfsbuildservice_2.exe &amp;amp; tfsbuildservice_2.exe.config).&lt;br /&gt;
   They are located within the following directory:&lt;br /&gt;
   &amp;lt;Program Files&amp;gt;\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies&lt;/tt&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small"&gt;&lt;span style="font-family: Courier New"&gt;&lt;tt&gt;2) Modify port setting.&lt;br /&gt;
   Edit the new config file (tfsbuildservice_2.exe.config) and update the following line with a new port number (eg 9193):&lt;br /&gt;
   &amp;lt;add key="port" value="9191" /&amp;gt;&lt;/tt&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small"&gt;&lt;span style="font-family: Courier New"&gt;&lt;tt&gt;3) Make the new service use .Net 4.0 - by changing the MSBuildPath - so it references MSBuild 4 (for VS2010/.Net 4.0 projects).&lt;br /&gt;
   Change the following line in tfsbuildservice_2.exe.config from:&lt;br /&gt;
    &amp;lt;add key="MSBuildPath" value="" /&amp;gt;&lt;br /&gt;
   to&lt;br /&gt;
    &amp;lt;add key="MSBuildPath" value="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319" /&amp;gt;&lt;/tt&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small"&gt;&lt;span style="font-family: Courier New"&gt;&lt;tt&gt;4) Configure URL ACLs.  Do this by running the wcfhttpconfig.exe utility in the new directory using the following syntax:&lt;br /&gt;
  wcfhttpconfig reserve &amp;lt;domain&amp;gt;\&amp;lt;user name&amp;gt; &amp;lt;port number&amp;gt;&lt;br /&gt;
  *** You must run this command as a local administrator.&lt;/tt&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small"&gt;&lt;span style="font-family: Courier New"&gt;&lt;tt&gt;5) Create the new windows service.&lt;br /&gt;
   Execute the following command at the command prompt - as an administrator.  Note the spaces after the equals signs.&lt;br /&gt;
   sc.exe create "VSTFBUILD_2" binpath= "D:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\TFSBuildService_2.exe" DisplayName= "Visual Studio Team Foundation Build Service 2 (for VS2010 and .Net 4.0 projects)"  &lt;br /&gt;
  *** You must run this command as a local administrator.&lt;/tt&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small"&gt;&lt;span style="font-family: Courier New"&gt;&lt;tt&gt;6) Open the new service's properties and set the account and password to run as, then start it.  &lt;br /&gt;
   It would also pay to set this service's startup type to automatic.&lt;/tt&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;You will need to create new Build Agents to point to this new service.&lt;/p&gt;
&lt;p&gt;HTH&lt;br /&gt;
Tim&lt;/p&gt; &lt;img src="http://geekswithblogs.net/TimH/aggbug/142959.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2010/12/01/creating-mulitple-tfs-build-services-on-the-same-server.aspx</guid>
            <pubDate>Thu, 02 Dec 2010 02:51:59 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/142959.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2010/12/01/creating-mulitple-tfs-build-services-on-the-same-server.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/142959.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/142959.aspx</trackback:ping>
        </item>
        <item>
            <title>Upgrade TFS 2008 to be able to build VS2010 solutions/projects - need to delete workspaces</title>
            <link>http://geekswithblogs.net/TimH/archive/2010/08/22/upgrade-tfs-2008-to-be-able-to-build-vs2010-solutionsprojects.aspx</link>
            <description>&lt;p&gt;After following steps in &lt;a href="http://www.richard-banks.org/2009/11/how-to-build-vs2010-solutions-using.html"&gt;this link&lt;/a&gt;, I found that my projects would still not build correctly. &lt;/p&gt;
&lt;p&gt;The error I got in the build was:&lt;/p&gt;
&lt;p&gt;"The path C:\Documents and Settings\myBuildServiceUser\Local Settings\Temp\myProject\Build1\Sources\WindowsFormsApplication1 is already mapped in workspace myBuildServerMachineName_16."&lt;/p&gt;
&lt;p&gt;To fix this problem you need to delete all workspaces on the build server (owned by the user account that the build service runs as) - these are named buildservername_nn where buildservername is your build server name and nn is a number it assigns as it generates them (upon the first time a build is run).  It appear that these old workspaces are incompatible with the MSBuild 4.0 engine - hence we delete them so it can re-create them upon next build.&lt;/p&gt;
&lt;p&gt;To get a list of all the workspaces on the build server use this command:&lt;/p&gt;
&lt;p&gt;tf.exe workspaces /owner:myTFSBuildServiceUser /server:myTFSServer /computer:myBuildServerMachineName&lt;/p&gt;
&lt;p&gt;tf.exe is run from the VS command prompt (TFS/VS2008 install dir: C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE).&lt;/p&gt;
&lt;p&gt;or just run a build - to get the error message mentioned above - this will provide the problem workspace name (eg myBuildServerMachineName_16).&lt;/p&gt;
&lt;p&gt;The following command will delete a workspace:&lt;/p&gt;
&lt;p&gt;tf.exe workspace /delete /server:myTFSServer workspaceName;myBuildServerUser&lt;/p&gt;
&lt;p&gt;See &lt;a href="http://msmvps.com/blogs/vstsblog/archive/2007/08/30/how-to-remove-someone-else-s-workspace-in-tfs.aspx"&gt;this article&lt;/a&gt; for how to delete workspaces.&lt;/p&gt;
&lt;p&gt;Attrice's &lt;a href="http://www.attrice.info/downloads/"&gt;Team Foundation Sidekicks &lt;/a&gt;provides a nice GUI to both view and remove workspaces.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UPDATE 21 September 2010&lt;/strong&gt;:&lt;br /&gt;
Updated/re-written to correct a number of things.  &lt;/p&gt;
&lt;p&gt;If you get the following error:&lt;br /&gt;
"TF30076: The server name myTFSServer provided does not correspond to a server URI that can be found. Confirm that the server name is correct."&lt;br /&gt;
Then you will need to specify it's full URI eg: &lt;br /&gt;
tf.exe workspace /delete /server:&lt;a href="http://myTFSServer:8080"&gt;http://myTFSServer:8080&lt;/a&gt; myBuildServer_16;myBuildServerUser&lt;br /&gt;
See &lt;a href="http://blogs.msdn.com/b/granth/archive/2008/07/22/tf30076-confirm-that-the-server-name-is-correct.aspx"&gt;this article&lt;/a&gt; regarding this error.&lt;/p&gt;
&lt;p&gt;HTH&lt;br /&gt;
Tim&lt;/p&gt; &lt;img src="http://geekswithblogs.net/TimH/aggbug/141437.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2010/08/22/upgrade-tfs-2008-to-be-able-to-build-vs2010-solutionsprojects.aspx</guid>
            <pubDate>Sun, 22 Aug 2010 22:51:06 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/141437.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2010/08/22/upgrade-tfs-2008-to-be-able-to-build-vs2010-solutionsprojects.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/141437.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/141437.aspx</trackback:ping>
        </item>
        <item>
            <title>VS2010 debugger catching AssertFailedException instead of running and failing tests</title>
            <link>http://geekswithblogs.net/TimH/archive/2010/07/28/vs2010-debugger-catching-assertfailedexception-instead-of-running-and-failing-tests.aspx</link>
            <description>&lt;p&gt;When workig on a project in VS2010 and performing a "run tests in context" the debugger was catching and halting on a test that fails, raising the exception AssertFailedException.  I thought this was strange as the same test (in fact any test) that failed in VS2008 would simply just be noted in the test results as Failed...&lt;/p&gt;
&lt;p&gt;Turns out it's the way I've been running tests..&lt;/p&gt;
&lt;p&gt;Both VS2008 and VS2010 have the same shortcut mappings:&lt;br /&gt;
- "ctrl-r, t" for "Run tests in context"&lt;br /&gt;
- "ctrl-r, ctrl-t" for "Debug tests in context"&lt;/p&gt;
&lt;p&gt;I've always done "ctrl-r, ctrl-t" - holding down ctrl then pressing r, releasing r then pressing t (while still holding down ctrl) then t then releasing ctrl.  This is actually "ctrl-r, ctrl-t".. so should have been invoking "debug tests in context" - but in VS2008 it was not detecting that I was holding down the ctrl when pressing t.&lt;/p&gt;
&lt;p&gt;So, now that vs2010 is properly detecting the ctrl key, its running "debug tests in context" (as it should), hence I'm seeing the AssertFailedException being caught by the debugger instead of just failing the test.&lt;/p&gt;
&lt;p&gt;So the solution is for me to use the proper shortcut to "Run tests in context" which is": "ctrl-r, t" - hold down ctrl, press r, release r and release ctrl, then press t (by itself).&lt;/p&gt;
&lt;p&gt;HTH&lt;br /&gt;
Tim&lt;/p&gt; &lt;img src="http://geekswithblogs.net/TimH/aggbug/141106.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2010/07/28/vs2010-debugger-catching-assertfailedexception-instead-of-running-and-failing-tests.aspx</guid>
            <pubDate>Thu, 29 Jul 2010 02:18:10 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/141106.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2010/07/28/vs2010-debugger-catching-assertfailedexception-instead-of-running-and-failing-tests.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/141106.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/141106.aspx</trackback:ping>
        </item>
        <item>
            <title>Databinding a .Net WinForms ComboBox to an Enum</title>
            <link>http://geekswithblogs.net/TimH/archive/2010/04/07/databinding-a-.net-winforms-combobox-to-an-enum.aspx</link>
            <description>&lt;p&gt;This is quite simple...&lt;/p&gt;
&lt;p&gt;Define the enum eg:&lt;/p&gt;
&lt;pre&gt;
public enum MyEnum{
  ItemOne,
  ItemTwo,
}&lt;/pre&gt;
&lt;p&gt;Within the form set the datasource of the combobox to the values of the enum eg:&lt;/p&gt;
&lt;pre&gt;
myCombo.DataSource = System.Enum.GetValues(typeof(MyEnum));&lt;/pre&gt;
&lt;p&gt;To have the combo auto select a value based on a bound object, set the databinding of the combo eg:&lt;/p&gt;
&lt;pre&gt;
class MyObject{
  private MyEnum myEnumProperty;
  public MyEnum MyEnumProperty{get {return myEnumProperty;}}
}
MyObject myObj = new MyObject();
myCombo.DataBindings.Add(new Binding("SelectedIndex", myObject, "MyEnumProperty");&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/TimH/aggbug/139151.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Tim Huffam</dc:creator>
            <guid>http://geekswithblogs.net/TimH/archive/2010/04/07/databinding-a-.net-winforms-combobox-to-an-enum.aspx</guid>
            <pubDate>Thu, 08 Apr 2010 03:00:19 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/TimH/comments/139151.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/TimH/archive/2010/04/07/databinding-a-.net-winforms-combobox-to-an-enum.aspx#feedback</comments>
            <slash:comments>16</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/TimH/comments/commentRss/139151.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/TimH/services/trackbacks/139151.aspx</trackback:ping>
        </item>
        <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;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>
            <slash:comments>1</slash: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;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>
            <slash:comments>6</slash: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;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>
            <slash:comments>2</slash: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>
    </channel>
</rss>
