<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results for 'app:weblogs' matching tag '.NET'</title><link>http://msmvps.com/search/SearchResults.aspx?q=app:weblogs&amp;tag=.NET&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:weblogs' matching tag '.NET'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Compiling .NET 1.1 Projects In Visual Studio 2008</title><link>http://msmvps.com/blogs/paulomorgado/archive/2009/10/26/compiling-net-1-1-projects-in-visual-studio-2008.aspx</link><pubDate>Mon, 26 Oct 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1735161</guid><dc:creator>paulo</dc:creator><description>&lt;p align="justify"&gt;After having put my &lt;strong&gt;&lt;a title="Microsoft .NET Framework" href="https://www.microsoft.com/net/" target="_blank"&gt;.NET&lt;/a&gt; 1.1&lt;/strong&gt; application running on the &lt;strong&gt;.NET 2.0&lt;/strong&gt; runtime (&lt;a title="Running .NET 1.1 Applications On .NET 2.0" href="http://msmvps.com/blogs/paulomorgado/archive/2009/10/20/running-net-1-1-applications-on-net-2-0.aspx" target="_blank"&gt;^&lt;/a&gt;), I’m planning on migrating it to &lt;strong&gt;.NET 2.0&lt;/strong&gt;, but not all at once.&lt;/p&gt;  &lt;p align="justify"&gt;Because I don’t want to have 2 solutions (one on &lt;strong&gt;Visual Studio 2003&lt;/strong&gt; for the &lt;strong&gt;.NET 1.1&lt;/strong&gt; assemblies and another on &lt;strong&gt;Visual Studio 2008&lt;/strong&gt; for the &lt;strong&gt;.NET 2.0&lt;/strong&gt; assemblies) I decide to try using &lt;a title="MSBuild Extras - Toolkit for .NET 1.1" href="http://www.codeplex.com/MSBee" target="_blank"&gt;MSBee&lt;/a&gt; and have only one &lt;a title="Microsoft Visual Studio" href="http://www.microsoft.com/visualstudio/default.mspx" target="_blank"&gt;Visual Studio&lt;/a&gt; 2008 solution.&lt;/p&gt;  &lt;p align="justify"&gt;&lt;strong&gt;MSBee&lt;/strong&gt; has a &lt;a title="Project Hosting for Open Source Software" href="http://www.codeplex.com/" target="_blank"&gt;CodePlex&lt;/a&gt; project. You can download it from there or from &lt;a title="MSBuild Extras - Toolkit for .NET 1.1" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=E0D0776F-25C4-444A-A6B9-71D06826F5B4"&gt;Microsoft Downloads&lt;/a&gt;. Because the build on Microsoft Downloads seemed to be the most stable one, that was the one I downloaded and installed. The package comes with a &lt;a title="Microsoft Office Word" href="http://office.microsoft.com/word/default.aspx" target="_blank"&gt;Word&lt;/a&gt; document that explains all that needs to be done.&lt;/p&gt;  &lt;p align="justify"&gt;Before you can install and use &lt;strong&gt;MSBee&lt;/strong&gt; you’ll need to install the &lt;a title=".NET Framework SDK Version 1.1" href="http://www.microsoft.com/downloads/details.aspx?familyid=9B3A2CA6-3647-4070-9F41-A333C6B9181D" target="_blank"&gt;.NET 1.1 SDK&lt;/a&gt;.&lt;/p&gt;  &lt;p align="justify"&gt;Having everything installed, I just opened the &lt;strong&gt;Visual Studio 2003&lt;/strong&gt; solution in &lt;strong&gt;Visual Studio 2008&lt;/strong&gt; and let it convert the solution and projects (near 30).&lt;/p&gt;  &lt;p align="justify"&gt;After the conversion, for building the projects with the &lt;strong&gt;.NET 1.1&lt;/strong&gt; &lt;a title="Visual C# Developer Center" href="http://msdn.microsoft.com/vcsharp/default.aspx" target="_blank"&gt;C#&lt;/a&gt; compiler, the project files need to be edited to add the override the default targets with the &lt;strong&gt;MSBee&lt;/strong&gt; ones by adding the &lt;strong&gt;MSBee&lt;/strong&gt; imports after the default imports for the language: &lt;/p&gt;  &lt;pre style="font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;overflow:auto;" class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Import &lt;/span&gt;&lt;span style="color:red;"&gt;Project&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;$(MSBuildBinPath)\Microsoft.CSharp.targets&lt;/span&gt;&amp;quot; &lt;span style="color:blue;font-size:larger;font-weight:bold;"&gt;/&amp;gt;
&lt;span&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Import &lt;/span&gt;&lt;span style="color:red;"&gt;Project&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;$(MSBuildExtensionsPath)\MSBee\MSBuildExtras.FX1_1.CSharp.targets&lt;/span&gt;&amp;quot; &lt;span style="color:blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p align="justify"&gt;Another change needed (for &lt;strong&gt;Visual Studio 2008&lt;/strong&gt; - I don&amp;#39;t know if it was needed for &lt;strong&gt;Visual Studio 2005&lt;/strong&gt;) is the tools version. &lt;strong&gt;MSBee&lt;/strong&gt; needs version 2.0. To change that you&amp;#39;ll have to change the ToolsVersion attribute of the project’s root element:&lt;/p&gt;

&lt;pre style="font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;overflow:auto;" class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Project &lt;/span&gt;&lt;span style="color:red;"&gt;DefaultTargets&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;Build&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;ToolsVersion&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;font-size:larger;font-weight:bold;text-decoration:underline;"&gt;2.0&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;http://schemas.microsoft.com/developer/msbuild/2003&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p align="justify"&gt;&lt;strong&gt;MSBee&lt;/strong&gt; likes has own idea about output paths and I had set up custom output paths on my project. There’s information about this on the documentation but I decided to simply comment that out of the &lt;span style="font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;"&gt;$(MSBuildExtensionsPath)\MSBee\MSBuildExtras.FX1_1.Common.targets&lt;/span&gt; file:&lt;/p&gt;

&lt;pre style="font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;overflow:auto;" class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;!-- &lt;/span&gt;&lt;span style="color:green;"&gt;Paulo
&amp;lt;Choose&amp;gt;
  &amp;lt;When Condition=&amp;quot; &amp;#39;$(BaseFX1_1OutputPath)&amp;#39; == &amp;#39;&amp;#39; &amp;quot;&amp;gt;
    &amp;lt;PropertyGroup&amp;gt;
      &amp;lt;OutputPath&amp;gt;bin\FX1_1\&amp;lt;/OutputPath&amp;gt;
    &amp;lt;/PropertyGroup&amp;gt;
  &amp;lt;/When&amp;gt;
  &amp;lt;Otherwise&amp;gt;
    &amp;lt;PropertyGroup&amp;gt;
      &amp;lt;OutputPath&amp;gt;$(BaseFX1_1OutputPath)&amp;lt;/OutputPath&amp;gt;
      &amp;lt;OutputPath Condition=&amp;quot; !HasTrailingSlash(&amp;#39;$(OutputPath)&amp;#39;) &amp;quot;&amp;gt;$(OutputPath)\&amp;lt;/OutputPath&amp;gt;
    &amp;lt;/PropertyGroup&amp;gt;
  &amp;lt;/Otherwise&amp;gt;
&amp;lt;/Choose&amp;gt;
&lt;/span&gt;&lt;span style="color:blue;"&gt;--&amp;gt;

&amp;lt;!-- &lt;/span&gt;&lt;span style="color:green;"&gt;Paulo
&amp;lt;PropertyGroup&amp;gt;
  &amp;lt;BaseIntermediateOutputPath&amp;gt;obj\FX1_1\&amp;lt;/BaseIntermediateOutputPath&amp;gt;
  &amp;lt;IntermediateOutputPath Condition=&amp;quot; &amp;#39;$(PlatformName)&amp;#39; == &amp;#39;AnyCPU&amp;#39; &amp;quot;&amp;gt;$(BaseIntermediateOutputPath)$(Configuration)\&amp;lt;/IntermediateOutputPath&amp;gt;
  &amp;lt;IntermediateOutputPath Condition=&amp;quot; &amp;#39;$(PlatformName)&amp;#39; != &amp;#39;AnyCPU&amp;#39; &amp;quot;&amp;gt;$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\&amp;lt;/IntermediateOutputPath&amp;gt;

  &amp;lt;OutputPath Condition=&amp;quot; &amp;#39;$(PlatformName)&amp;#39; == &amp;#39;AnyCPU&amp;#39; &amp;quot;&amp;gt;$(OutputPath)$(Configuration)\&amp;lt;/OutputPath&amp;gt;
  &amp;lt;OutputPath Condition=&amp;quot; &amp;#39;$(PlatformName)&amp;#39; != &amp;#39;AnyCPU&amp;#39; &amp;quot;&amp;gt;$(OutputPath)$(PlatformName)\$(Configuration)\&amp;lt;/OutputPath&amp;gt;
  
  &amp;lt;- Once OutputPath is determined, set OutDir to its value. -&amp;gt;
  &amp;lt;OutDir&amp;gt;$(OutputPath)&amp;lt;/OutDir&amp;gt;
&amp;lt;/PropertyGroup&amp;gt;
&lt;/span&gt;&lt;span style="color:blue;"&gt;--&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p align="justify"&gt;This all seemed to work fine on my old Windows XP machine without any third party Visual Studio plug-ins, but when I tried it on my Windows Vista X64 machine, I came across some problems:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;div align="left"&gt;License Compiler&lt;/div&gt;

    &lt;p align="justify"&gt;Because I&amp;#39;m using &lt;a title="Infragistics - User Interface Components" href="http://www.infragistics.com/" target="_blank"&gt;Infragistics&lt;/a&gt;&amp;#39; controls, there&amp;#39;s a licences.licx file and the build will compile it. And that proved to be a problem.&lt;/p&gt;

    &lt;p align="justify"&gt;MSBee copies all the files it needs to the build process to a temporary folder, builds it in there and then copies the result to the output path.&lt;/p&gt;

    &lt;p align="justify"&gt;LC.exe seemed to never be able to find all the assemblies it needed. Searching seemed to me to be an old issue (even from the .NET 1.1 times) and the solution always pointed to not compile the license file. So, I commented that part out of the &lt;span style="font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;"&gt;$(MSBuildExtensionsPath)\MSBee\MSBuildExtras.FX1_1.Common.targets&lt;/span&gt; file:&lt;/p&gt;

    &lt;pre style="font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;overflow:auto;" class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Target
    &lt;/span&gt;&lt;span style="color:red;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;CompileLicxFiles&lt;/span&gt;&amp;quot;&amp;#160; &lt;span style="color:red;"&gt;Condition&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;#39;@(_LicxFile)&amp;#39;!=&amp;#39;&amp;#39;&lt;/span&gt;&amp;quot;
    &lt;span style="color:red;"&gt;DependsOnTargets&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;$(CompileLicxFilesDependsOn)&lt;/span&gt;&amp;quot;
    &lt;span style="color:red;"&gt;Inputs&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;$(MSBuildAllProjects);@(_LicxFile);@(ReferencePath);@(ReferenceDependencyPaths)&lt;/span&gt;&amp;quot;
    &lt;span style="color:red;"&gt;Outputs&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;$(IntermediateOutputPath)$(TargetFileName).licenses&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;&amp;gt;

  &amp;lt;!--
  &lt;/span&gt;&lt;span style="color:green;"&gt;&amp;lt;LC
      Sources=&amp;quot;@(_LicxFile)&amp;quot;
      LicenseTarget=&amp;quot;$(TargetFileName)&amp;quot;
      OutputDirectory=&amp;quot;$(IntermediateOutputPath)&amp;quot;
      OutputLicense=&amp;quot;$(IntermediateOutputPath)$(TargetFileName).licenses&amp;quot;
      ReferencedAssemblies=&amp;quot;@(ReferencePath);@(ReferenceDependencyPaths)&amp;quot;
      ToolPath=&amp;quot;$(TargetFrameworkSDKDirectory)bin\&amp;quot;&amp;gt;

    &amp;lt;Output TaskParameter=&amp;quot;OutputLicense&amp;quot; ItemName=&amp;quot;CompiledLicenseFile&amp;quot;/&amp;gt;
    &amp;lt;Output TaskParameter=&amp;quot;OutputLicense&amp;quot; ItemName=&amp;quot;FileWrites&amp;quot;/&amp;gt;

  &amp;lt;/LC&amp;gt;
  &lt;/span&gt;&lt;span style="color:blue;"&gt;--&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Target&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
    &lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;
    &lt;div align="left"&gt;Resource Generator&lt;/div&gt;

    &lt;p align="justify"&gt;Although this worked fine on the command line, inside &lt;strong&gt;Visual Studio&lt;/strong&gt; &lt;span style="font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;"&gt;ResGen.exe&lt;/span&gt; would throw some error and needed to be closed.&lt;/p&gt;

    &lt;p align="justify"&gt;Looking at the &lt;a title="Windows Application Log" href="http://technet.microsoft.com/library/ms157312.aspx" target="_blank"&gt;Windows Application Log&lt;/a&gt; I found out this:&lt;/p&gt;

    &lt;div align="justify"&gt;
      &lt;p style="font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;overflow:auto;" class="code"&gt;Faulting application Resgen.exe, version 1.1.4322.573, time stamp 0x3e559b5f, faulting module MockWeaver.dll, version 0.0.0.0, time stamp 0x4adb072e, exception code 0xc0000005, fault offset 0x00018fac, process id 0x4a50, application start time 0x01ca53c14488a2fb. &lt;/p&gt;
    &lt;/div&gt;

    &lt;p align="justify"&gt;&lt;strong&gt;MockWeaver.dll&lt;/strong&gt; belongs to &lt;a title="Typemock Isolator - Isolate any .NET dependencies to make unit testing easy" href="http://www.typemock.com/" target="_blank"&gt;Isolator&lt;/a&gt; and I just disable it when building inside &lt;strong&gt;Visual Studio&lt;/strong&gt;. I was hoping to start using Isolator on this project, but, for now, I can&amp;#39;t.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p align="justify"&gt;I hope this can be of some help and, if you need more, you’ll probably find it at the &lt;strong&gt;MSBee&lt;/strong&gt;’s &lt;strong&gt;CodePlex&lt;/strong&gt; forum.&lt;/p&gt;

&lt;p align="justify"&gt;The bottom line is: &lt;strong&gt;You don’t need Visual Studio 2003!&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Workflow 4 and Visual Basic expressions</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2009/10/26/workflow-4-and-visual-basic-expressions.aspx</link><pubDate>Mon, 26 Oct 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1735366</guid><dc:creator>Maurice</dc:creator><description>&lt;p&gt;When using Windows Workflow Foundation 4 you often need to enter expression in some activity property. The new thing is these expressions are all in the Visual Basic dialect regardless of what language you project is in. So when developing a project in C# the expressions are sill in Visual Basic.&lt;/p&gt;  &lt;p&gt;Weird right?&lt;/p&gt;  &lt;p&gt;Well not really when you think about it!&lt;/p&gt;  &lt;p&gt;After all power business users are expected to be able to modify workflows. And guess what their favorite tools are. That would be Microsoft Excel and Word. And what do they use to create macros? Right Visual Basic for Applications is their language of choice.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So if they use VBA letting them enter VB into expression dialogs is a far more natural fit than having them use C#.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h3&gt;A case for the Delay activity&lt;/h3&gt;  &lt;p&gt;So lets take a look at the delay activity. This activity takes 1 input property Duration of type Time Span. So I guess that means our VBA power users are going to have to enter something like if they want to wait 5 seconds:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/theproblemsolver.metablogapi/3175.image_5F00_51844A7D.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/theproblemsolver.metablogapi/4670.image_5F00_thumb_5F00_10099824.png" width="346" height="201" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now for some reason I suspect that is not the first thing they are going to type. In fact they are more likely to time something like “0:0:05” instead. Not very VB like right?&lt;/p&gt;  &lt;p&gt;Well it turns out workflow is smart enough to realize it can convert the string literal to a Time Span and use this. So when our power users does the following it just works &lt;img src="http://msmvps.com/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/theproblemsolver.metablogapi/2514.image_5F00_75C92EFF.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/theproblemsolver.metablogapi/3187.image_5F00_thumb_5F00_5F9313AD.png" width="344" height="202" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Nice, I like this!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Enjoy WF4!&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.theproblemsolver.nl/"&gt;www.TheProblemSolver.nl &lt;/a&gt;   &lt;br /&gt;&lt;a href="http://wiki.windowsworkflowfoundation.eu/"&gt;Wiki.WindowsWorkflowFoundation.eu&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Call for speakers: 3rd Dutch Code Camp</title><link>http://msmvps.com/blogs/theproblemsolver/archive/2009/10/26/call-for-speakers-3rd-dutch-code-camp.aspx</link><pubDate>Mon, 26 Oct 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1735301</guid><dc:creator>Maurice</dc:creator><description>&lt;p&gt;Op 21 november 2009 organiseren de SDN, de dotNED User Group en VBcentral.nl samen de derde Nederlandse Code Camp. Een unieke dag, voortkomend uit een unieke samenwerking. Kenmerkend aan deze dag is, dat het een evenement is dóór ontwikkelaars en vóór ontwikkelaars!&lt;/p&gt;  &lt;p&gt;We zijn op zoek naar collega ontwikkelaars die het leuk vinden om ook een sessie voor hun rekening te nemen. Er is ruimte voor de meer traditionele sessies, maar bijvoorbeeld ook voor Chalk &amp;amp; Talk sessies. In principe is zijn de mogelijke onderwerpen zeer divers en worden door ons op voorhand niet beperkt. Ben jij geïnteresseerd om ook een sessie te doen? Laat het ons weten! Ook als je geen of nog niet zoveel sprekerservaring hebt ben je meer dan welkom. Indien je dat wilt willen we je hier best mee helpen.&lt;/p&gt;  &lt;p&gt;Het evenement vindt plaats in Rotterdam en meer informatie kun je vinden op de Code Camp website:&lt;a href="http://www.codecamp.nl"&gt;www.codecamp.nl&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;We zien graag jouw sessievoorstel tegemoet! Stuur deze zo snel mogelijk naar: &lt;a href="mailto:andre@obelink.com"&gt;andre@obelink.com&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Een lijstje van onderwerpen waar deelnemers ondermeer om vragen:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Architectuur/Design patterns&lt;/li&gt;    &lt;li&gt;Frameworks&lt;/li&gt;    &lt;li&gt;Surface&lt;/li&gt;    &lt;li&gt;.NET 4/3.5&lt;/li&gt;    &lt;li&gt;Visual Studio 2010&lt;/li&gt;    &lt;li&gt;VSTS&lt;/li&gt;    &lt;li&gt;Open Source&lt;/li&gt;    &lt;li&gt;SharePoint&lt;/li&gt;    &lt;li&gt;ASP.NET/MVC/Web development/Silverlight&lt;/li&gt;    &lt;li&gt;Windows 7&lt;/li&gt;    &lt;li&gt;iPhone&lt;/li&gt;    &lt;li&gt;DNN&lt;/li&gt;    &lt;li&gt;VSTO&lt;/li&gt;    &lt;li&gt;LINQ&lt;/li&gt;    &lt;li&gt;SQL Server 2008&lt;/li&gt;    &lt;li&gt;Geneva&lt;/li&gt;    &lt;li&gt;BizTalk&lt;/li&gt;    &lt;li&gt;Windows Presentation Foundation&lt;/li&gt;    &lt;li&gt;Windows Communication Foundation&lt;/li&gt;    &lt;li&gt;Windows Workflow Foundation&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://www.theproblemsolver.nl/"&gt;www.TheProblemSolver.nl &lt;/a&gt;   &lt;br /&gt;&lt;a href="http://wiki.windowsworkflowfoundation.eu/"&gt;Wiki.WindowsWorkflowFoundation.eu&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Code Kata: Capturando p&amp;#225;ginas web</title><link>http://msmvps.com/blogs/lopez/archive/2009/10/26/code-kata-capturando-p-225-ginas-web.aspx</link><pubDate>Mon, 26 Oct 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1735292</guid><dc:creator>lopez</dc:creator><description>&lt;p&gt;&lt;img style="display:inline;margin:0px 20px 20px 0px;" src="http://www.todocontenidos.com/images/articles/scrap03.png" align="left" alt="" /&gt; Para practicar, como &lt;a href="http://codekata.pragprog.com/codekata/" target="_blank"&gt;Code Kata&lt;/a&gt; (y también, como prueba de concepto para un proyecto relacionado con &lt;a title="Hacia una Historia Clínica Digital de Código Abierto" href="http://msmvps.com/blogs/lopez/archive/2009/09/29/hacia-una-historia-cl-237-nica-digital-de-c-243-digo-abierto.aspx"&gt;Hacia una Historia Clínica Digital de Código Abierto&lt;/a&gt;), estuve codificando un programa de &lt;a href="http://en.wikipedia.org/wiki/Web_scraping" target="_blank"&gt;Web Scraping&lt;/a&gt;. Pueden bajarse el código completo desde: &lt;a href="http://code.google.com/p/ajcodekatas/source/browse/#svn/trunk/WebScrappingExample" target="_blank"&gt;Web Scrapping Example&lt;/a&gt; (pensé que en inglés era “scrapping” con doble p, así que quedó por ahora con ese nombre :-)&lt;/p&gt;  &lt;p&gt;La solución, escrita en C#, contiene un proyecto de librería de clases, uno de tests de Visual Studio, y un programa de demostración, del tipo consola. Fue interesante codificar un mini HTML parser (simple, que no contempla todos los casos, sólo los necesarios para el trabajo), que soporta el análisis de páginas mal formadas. El usar TDD (&lt;a href="http://en.wikipedia.org/wiki/Test-driven_development" target="_blank"&gt;Test-Driven Development&lt;/a&gt;) me permitió ir codificándolo de forma de estar seguro de lo que necesitaba como resultado, y además, que ese resultado fuera el correcto. Ejemplo de test simple:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div id="codeSnippet" style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;"&gt;     &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;"&gt;[TestMethod]&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; ParseSimpleTag()&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;"&gt;{&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;"&gt;    HtmlParser parser = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; HtmlParser(&lt;span style="color:#006080;"&gt;&amp;quot;&amp;lt;html&amp;gt;&amp;quot;&lt;/span&gt;);&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;"&gt;    HtmlToken token = parser.NextToken();&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;"&gt;&amp;#160;&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;"&gt;    Assert.IsNotNull(token);&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;"&gt;    Assert.AreEqual(HtmlTokenType.Tag, token.TokenType);&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;"&gt;    Assert.AreEqual(&lt;span style="color:#006080;"&gt;&amp;quot;html&amp;quot;&lt;/span&gt;, token.Name);&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;"&gt;&amp;#160;&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;"&gt;    Assert.IsNull(parser.NextToken());&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Para capturar las páginas, usé System.Net.WebClient, con código tan simple como:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div id="codeSnippet" style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;"&gt;
    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;"&gt;&lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; GetContent()&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;"&gt;{&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;"&gt;    WebClient webclient = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; WebClient();&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;text-align:left;border-bottom-style:none;"&gt;    &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; webclient.DownloadString(&lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.address);&lt;/pre&gt;


    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;direction:ltr;border-top-style:none;line-height:12pt;padding-top:0px;font-family:&amp;#39;Courier New&amp;#39;, courier, monospace;border-right-style:none;border-left-style:none;background-color:white;text-align:left;border-bottom-style:none;"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Como demostración, en el programa de consola, parto de explorar la página:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.nlm.nih.gov/medlineplus/druginfo/meds/a699012.html" target="_blank"&gt;Medline Plus Drugs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lanzando el programa de consola, aparece la salida, capturando algunos cientos de páginas, sobre información de drogas medicinales (efectos, posología, contraindicaciones, etc):&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.todocontenidos.com/images/articles/scrap02.png" alt="" /&gt; &lt;/p&gt;

&lt;p&gt;Exploro las páginas que apuntan a la información de drogas por letra, obtengo los enlaces a cada droga, traigo el contenido de la página, extraigo la información que me interesa (descartando el principio y el fin de la página) por cada droga. Un ejemplo de página:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.todocontenidos.com/images/articles/scrap01.png" alt="" /&gt; &lt;/p&gt;

&lt;p&gt;Al final, genero una página de índice:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.todocontenidos.com/images/articles/scrap04.png" alt="" /&gt; &lt;/p&gt;

&lt;p&gt;Podría implementar un mejor parser de HTML, y algunas operaciones más de extracción de datos. Pero para lo que quería obtener, me bastó. Y fue una buena experiencia de TDD.&lt;/p&gt;

&lt;p&gt;Si usan la información generada, recuerden de leer los términos del sitio original (entiendo que necesitan una autorización para usarlo de forma comercial, no parece que haya problema en capturar los datos en un utilitario no comercial).&lt;/p&gt;

&lt;p&gt;¿Por qué no explorar directamente la web para obtener estos datos? Porque el contexto de la prueba de concepto que me impuse, es que los médicos y enfermeros no tienen acceso a Internet desde todas las máquinas donde van a estar trabajando.&lt;/p&gt;

&lt;p&gt;Nos leemos!&lt;/p&gt;

&lt;p&gt;Angel “Java” Lopez 
  &lt;br /&gt;&lt;a href="http://www.ajlopez.com"&gt;http://www.ajlopez.com&lt;/a&gt; 

  &lt;br /&gt;&lt;a href="http://twitter.com/ajlopez"&gt;http://twitter.com/ajlopez&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Unit Testing: Execution</title><link>http://msmvps.com/blogs/deborahk/archive/2009/10/25/unit-testing-execution.aspx</link><pubDate>Sun, 25 Oct 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1735158</guid><dc:creator>DeborahK</dc:creator><description>&lt;p&gt;Visual Studio 2008 (Professional Edition and above) provides a really nice set of tools for development and execution of unit tests.&lt;/p&gt;  &lt;p&gt;[To begin with an overview of unit testing, &lt;a href="http://msmvps.com/blogs/deborahk/archive/2009/10/25/unit-testing-an-introduction.aspx"&gt;start here&lt;/a&gt;.]&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/blogs/deborahk/archive/2009/10/25/unit-testing-an-introduction.aspx"&gt;This prior post&lt;/a&gt; demonstrates how to build a unit test using the &amp;quot;Create Unit Tests...&amp;quot; feature of the Code Editor. This post demonstrates how to execute a unit test.&lt;/p&gt;  &lt;p&gt;NOTE: This post assumes you have already generated or created at least one unit test.&lt;/p&gt;  &lt;p&gt;To execute one or more unit tests:&lt;/p&gt;  &lt;p&gt;1) Open your solution in Visual Studio.&lt;/p&gt;  &lt;p&gt;The solution should include both the project(s) to test and the test project(s).&lt;/p&gt;  &lt;p&gt;2) Select Test | Windows | Test View from the menu to view the Test View window. This window contains every method marked with the TestMethod attribute.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/2620.image_5F00_27D6A4F6.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/6518.image_5F00_thumb_5F00_40561C79.png" width="457" height="247" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The solution used for the screenshot above has two LastNameTest unit tests: One for the VB example and one for the C# example. If you coded along&amp;#160; from the prior unit testing post, you will only have one for whichever language you selected. If you have been creating unit tests for one of your projects, you may have hundreds of tests in this list.&lt;/p&gt;  &lt;p&gt;To execute unit tests:&lt;/p&gt;  &lt;p&gt;1) Select one or&amp;#160; more tests from the list of tests in the Test View window.&lt;/p&gt;  &lt;p&gt;You can add columns and sort the list or use the filter feature to make it easier to locate and select the desired tests to execute.&lt;/p&gt;  &lt;p&gt;2) Click the Run Selection button in the upper left&amp;#160; corner of the Test View window or right-click on any selected test and select &amp;quot;Run Selection&amp;quot; from the context menu.&lt;/p&gt;  &lt;p&gt;The selected test(s) will then execute, displaying their status in the Test Results window:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/6180.image_5F00_543F8942.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/4428.image_5F00_thumb_5F00_0A145890.png" width="505" height="142" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;When the test is complete, the Test Results window will look something like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/2055.image_5F00_1967BA9F.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/0777.image_5F00_thumb_5F00_75EB1639.png" width="499" height="128" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Both of&amp;#160; the tests shown in the above screenshot are marked as Inconclusive because the generated unit testing code used the Assert class Inconclusive method. The generated unit testing template is designed to prevent a false positive. It generates an inconclusive result until you update the unit test with correct valid and invalid values and remove the Inconclusive method call.&lt;/p&gt;  &lt;p&gt;To see more information on the result of the test, double-click on a test result.&lt;/p&gt;  &lt;p&gt;To run the test again, use the Run or Debug buttons at the top of the Test Results window.&lt;/p&gt;  &lt;p&gt;If any of&amp;#160; the tests don&amp;#39;t pass, they are marked as Failed in the Test Results window as shown below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/2475.image_5F00_57047C8E.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/5684.image_5F00_thumb_5F00_6A719095.png" width="499" height="138" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Double click on any of&amp;#160; the failed tests to view the test results:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/1033.image_5F00_085F78BD.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/2502.image_5F00_thumb_5F00_1A9819B2.png" width="475" height="389" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The Error Stack Trace at the bottom of this window gives you further information on the source of the failure. Click on any link in the stack trace to jump to the associated location in the code.&lt;/p&gt;  &lt;p&gt;You can also debug the code as the test is executing if you &amp;quot;Debug Selection&amp;quot; option instead of the &amp;quot;Run Selection&amp;quot; option.&lt;/p&gt;  &lt;p&gt;After you update the unit tests with valid code and the tests pass, the Test Results will appear as follows:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/3755.image_5F00_617116E2.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/6215.image_5F00_thumb_5F00_11B7EB99.png" width="473" height="131" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Notice the color-coded green passing indicator.&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;</description></item><item><title>Unit Testing: An Introduction</title><link>http://msmvps.com/blogs/deborahk/archive/2009/10/25/unit-testing-an-introduction.aspx</link><pubDate>Sun, 25 Oct 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1735139</guid><dc:creator>DeborahK</dc:creator><description>&lt;p&gt;If you have Visual Studio 2008 or later and have the Professional Edition or better (NOT the Express Editions), you have some very nice unit testing tools within your Visual Studio environment. These tools help you write, execute, and track your unit tests and code coverage. This post provides an introduction to using these tools.&lt;/p&gt;  &lt;p&gt;If you are new to unit testing, the idea is to test the smallest possible units of your code. In most cases, the smallest units of code are the property procedures and methods of your classes.&lt;/p&gt;  &lt;p&gt;For more general information about the purpose of unit testing, see &lt;a href="http://en.wikipedia.org/wiki/Unit_testing"&gt;this link&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;NOTE: Unit testing is not meant to replace integration testing, system testing, or user testing.&lt;/p&gt;  &lt;p&gt;In some development methodologies, such as Test Driven Development (TDD), unit tests are written &lt;em&gt;before&lt;/em&gt; the code is written. You capture the basic requirements in the unit test and then write the code. The code is complete when the unit tests&amp;#160; pass. Visual Studio 2010 has features to assist with this &amp;quot;unit test first&amp;quot; approach.&lt;/p&gt;  &lt;p&gt;But&amp;#160; this introduction demonstrates how to write unit tests for &lt;em&gt;existing&lt;/em&gt; code. This technique is helpful if you follow a code-first approach or if you received code from another source or have old code that did not originally have unit tests.&lt;/p&gt;  &lt;h2&gt;Build the Code&lt;/h2&gt;  &lt;p&gt;The business object tested in this post is a simplified Customer class that uses the business object base class defined in &lt;a href="http://msmvps.com/blogs/deborahk/archive/2009/07/21/building-a-business-object-base-class.aspx"&gt;this post&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The Customer class is shown below.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;In C#:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#65402e" face="Consolas"&gt;public class Customer: BoBase      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; private int? _CustomerId;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public int? CustomerId       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; get { return _CustomerId; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; internal set       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (_CustomerId == null || !_CustomerId.Equals(value))       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string propertyName = &amp;quot;CustomerId&amp;quot;;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#65402e" face="Consolas"&gt;// Perform any validation here      &lt;br /&gt;&lt;/font&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (!_CustomerId.Equals(value))      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _CustomerId = value;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SetEntityState(EntityStateType.Modified,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; propertyName);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160; private string _LastName;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public string LastName       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; get { return _LastName; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; set       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (_LastName == null || _LastName != value)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string propertyName = &amp;quot;LastName&amp;quot;;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Perform any validation here&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (_LastName != value)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _LastName = value;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SetEntityState(EntityStateType.Modified,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; propertyName);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160; private string _FirstName;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public string FirstName       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; get { return _FirstName; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; set       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (_FirstName == null || _FirstName != value)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string propertyName = &amp;quot;FirstName&amp;quot;;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Perform any validation here&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (_FirstName != value)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _FirstName = value;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SetEntityState(EntityStateType.Modified,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; propertyName);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160; private string _EmailAddress;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public string EmailAddress       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; get { return _EmailAddress; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; set       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (_EmailAddress == null || _EmailAddress != value)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string propertyName = &amp;quot;EmailAddress&amp;quot;;&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Perform any validation here&amp;#160; &lt;br /&gt;&lt;/font&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (_EmailAddress != value)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _EmailAddress = value;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SetEntityState(EntityStateType.Modified,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; propertyName);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;In VB:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#65402e" face="Consolas"&gt;Public Class Customer      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Inherits BOBase &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160; Private _CustomerId As Integer?      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Public Property CustomerId() As Integer?       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Get       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Return _CustomerId       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End Get       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Friend Set(ByVal value As Integer?)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;font color="#65402e" face="Consolas"&gt;If _CustomerId Is Nothing OrElse _      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Not _CustomerId.Equals(value) Then       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim propertyName As String = &amp;quot;CustomerId&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;#39; Perform any validation&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; If Not _CustomerId.Equals(value) Then       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _CustomerId = value       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SetEntityState(EntityStateType.Modified, propertyName)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End If       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End If       &lt;br /&gt;&lt;/font&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End Set      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; End Property &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160; Private _FirstName As String      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Public Property FirstName() As String       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Get       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Return _FirstName       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End Get       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Set(ByVal value As String)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; If _FirstName Is Nothing OrElse _       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _FirstName IsNot value Then       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim propertyName As String = &amp;quot;FirstName&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;#39; Perform any validation       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; If _FirstName IsNot value Then       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _FirstName = value       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SetEntityState(EntityStateType.Modified, _       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; propertyName)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End If       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End If       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End Set       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; End Property &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160; Private _LastName As String      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Public Property LastName() As String       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Get       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Return _LastName       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End Get       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Set(ByVal value As String)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; If _LastName Is Nothing OrElse _       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _LastName IsNot value Then       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim propertyName As String = &amp;quot;LastName&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;#39; Perform any validation       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; If _LastName IsNot value Then       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _LastName = value       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SetEntityState(EntityStateType.Modified, _       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; propertyName)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End If       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End If       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End Set       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; End Property &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160; Private _EmailAddress As String      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Public Property EmailAddress() As String       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Get       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Return _EmailAddress       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End Get       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Set(ByVal value As String)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; If _EmailAddress Is Nothing OrElse _       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _EmailAddress IsNot value Then       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Dim propertyName As String = &amp;quot;EmailAddress&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;#39; Perform any validation       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; If _EmailAddress IsNot value Then       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _EmailAddress = value       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SetEntityState(EntityStateType.Modified, _       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; propertyName)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End If       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End If       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; End Set       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; End Property       &lt;br /&gt;End Class&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;The first if statement in each of the property procedures for the Customer class checks whether the current value is null or was changed. If the property is changed, you want to revalidate it, set it as modified, and generate a PropertyChanged event (which is handled in the SetEntityState method).&lt;/p&gt;  &lt;p&gt;NOTE: C# uses a != operator to judge whether the value was changed. VB cannot use the &amp;lt;&amp;gt; operator because VB propagates null values. So if either value is null (nothing) the result is false. (See &lt;a href="http://msdn.microsoft.com/en-us/library/0x9tb07z.aspx"&gt;this msdn entry&lt;/a&gt; for more information.) To prevent this problem, IsNot is used in the VB code to determine if the value was changed.&lt;/p&gt;  &lt;p&gt;The null check allows for possible validation of required fields (that is, fields that cannot be null or empty). If you know you will never need a null validation check, you can leave the null check off the first if statement.&lt;/p&gt;  &lt;p&gt;The propertyName variable defines a name&amp;#160; that you can use in any validation error messages and it is the name used in the PropertyChanged event.&lt;/p&gt;  &lt;p&gt;You can then perform any necessary validation. In this simple example, no validation was added. If you want to see an example of some validation, check out &lt;a href="http://msmvps.com/blogs/deborahk/archive/2009/07/21/building-a-business-object-base-class.aspx"&gt;this post&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Finally, if the value was changed, the backing variable is set to the new value and the SetEntityState method is called&amp;#160; to mark the business object as&amp;#160; &amp;quot;dirty&amp;quot; and to generate the PropertyChanged event.&lt;/p&gt;  &lt;h2&gt;Define the Testing Scenarios&lt;/h2&gt;  &lt;p&gt;So let&amp;#39;s start with the test of the LastName property. Looking at the requirements, the following testing scenarios are required:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Initial null value; set to null value (should perform validation but not set the dirty flag) &lt;/li&gt;    &lt;li&gt;Initial null value; set to valid&amp;#160; string (should perform validation and set the dirty flag) &lt;/li&gt;    &lt;li&gt;Initial null value; set to empty string (should perform validation and set the dirty flag) &lt;/li&gt;    &lt;li&gt;Initial string value; set to null value (should perform validation and set the dirty flag) &lt;/li&gt;    &lt;li&gt;Initial string value, set to different string value (should perform validation and set the dirty flag) &lt;/li&gt;    &lt;li&gt;Initial string value, set&amp;#160; to same string value (should not&amp;#160; perform validation and not set the dirty flag) &lt;/li&gt;    &lt;li&gt;Initial string value, set&amp;#160; to empty value (should perform validation and set the dirty flag) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;And if you have validation code, you will have more scenarios to test valid and invalid values. But this is enough to give you the general idea.&lt;/p&gt;  &lt;p&gt;So now let&amp;#39;s generate the unit test for the LastName property using the tools provided in Visual Studio (Professional Edition or above).&lt;/p&gt;  &lt;h2&gt;Generate the Unit Test&lt;/h2&gt;  &lt;p&gt;The following are the steps for generating the unit test for a particular property procedure or method:&lt;/p&gt;  &lt;p&gt;1) Open the Code Editor for the code you want to test.&lt;/p&gt;  &lt;p&gt;2) Right-click and select Create Unit Tests... from the context menu.&lt;/p&gt;  &lt;p&gt;The following dialog will appear:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/7713.image_5F00_52563B2F.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/6646.image_5F00_thumb_5F00_77DFB890.png" width="430" height="318" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;3) Select the properties, methods, or&amp;#160; constructors you wish to test.&lt;/p&gt;  &lt;p&gt;If you were in a specific property procedure or method, that procedure or method is automatically checked in this dialog. You can select to generate tests for any properties, methods,&amp;#160; or constructors using this dialog.&lt;/p&gt;  &lt;p&gt;Notice the Output project combobox on this dialog. Using this combobox, you can create a new C# unit test, new VB unit test, or select any existing unit test project if you already&amp;#160; have some in your solution. This allows you to add unit tests to existing unit testing projects at any point in the development process.&lt;/p&gt;  &lt;p&gt;4) Click OK.&lt;/p&gt;  &lt;p&gt;5) If you are creating a new C# or VB project, enter the project name and click Create.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/0385.image_5F00_4F60D67C.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/4274.image_5F00_thumb_5F00_2E6D63D5.png" width="416" height="136" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;6) The test project is then added to your Solution Explorer.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/5734.image_5F00_0D79F12E.png"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/deborahk.metablogapi/6327.image_5F00_thumb_5F00_3E992BCE.png" width="408" height="327" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If you created a VB test project, the result is the same, but with a CustomerTest.vb file&amp;#160; within the BoTest project.&lt;/p&gt;  &lt;h2&gt;View the Generated Code&lt;/h2&gt;  &lt;p&gt;Visual Studio automatically creates an first cut of your unit testing code.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;In C#:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Double-click on&amp;#160; CustomerTest.cs to view the code.&lt;/p&gt;  &lt;p&gt;&lt;font color="#65402e" face="Consolas"&gt;/// &amp;lt;summary&amp;gt;      &lt;br /&gt;///A test for LastName       &lt;br /&gt;///&amp;lt;/summary&amp;gt;       &lt;br /&gt;[TestMethod()]       &lt;br /&gt;public void LastNameTest()       &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Customer target = new Customer(); // TODO: Initialize to an appropriate value       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; string expected = string.Empty; // TODO: Initialize to an appropriate value       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; string actual;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; target.LastName = expected;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; actual = target.LastName;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Assert.AreEqual(expected, actual);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Assert.Inconclusive(&amp;quot;Verify the correctness of this test method.&amp;quot;);       &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;In VB:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Double-click on CustomerTest.vb to view the code.&lt;/p&gt;  &lt;p&gt;&lt;font color="#65402e" face="Consolas"&gt;&amp;#39;&amp;#39;&amp;#39;&amp;lt;summary&amp;gt;      &lt;br /&gt;&amp;#39;&amp;#39;&amp;#39;A test for LastName       &lt;br /&gt;&amp;#39;&amp;#39;&amp;#39;&amp;lt;/summary&amp;gt;       &lt;br /&gt;&amp;lt;TestMethod()&amp;gt; _       &lt;br /&gt;Public Sub LastNameTest()       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Dim target As Customer = New Customer &amp;#39; TODO: Initialize to an appropriate value       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Dim expected As String = String.Empty &amp;#39; TODO: Initialize to an appropriate value       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Dim actual As String       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; target.LastName = expected       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; actual = target.LastName       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Assert.AreEqual(expected, actual)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Assert.Inconclusive(&amp;quot;Verify the correctness of this test method.&amp;quot;)       &lt;br /&gt;End Sub&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;The TestMethod attribute defines this method as a unit test. It is then picked up by the other unit testing tools within Visual Studio.&lt;/p&gt;  &lt;p&gt;The generated code includes some ToDo notes, defining where you should change the code.&lt;/p&gt;  &lt;p&gt;The Assert class is a key aspect of your unit tests. It provides many methods that you can use to assert whether your test produced expected results.&lt;/p&gt;  &lt;p&gt;The generated code uses two of the Assert class methods. The &lt;strong&gt;AreEqual&lt;/strong&gt; method determines whether the expected and actual values are equal. If not, it fails the test.&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;Inconclusive&lt;/strong&gt; method always causes the test to fail. This is added to all generated code to ensure that the test will fail until you modify the test with valid values.&lt;/p&gt;  &lt;p&gt;At this point, you can try to execute this unit test, or update it first and then execute it.&lt;/p&gt;  &lt;p&gt;See the following posts for more information:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msmvps.com/blogs/deborahk/archive/2009/10/25/unit-testing-execution.aspx"&gt;Unit Testing: Execution&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msmvps.com/blogs/deborahk/archive/2009/10/25/unit-testing-code-coverage.aspx"&gt;Unit Testing: Code Coverage&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Unit Testing: Testing Properties &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;</description></item><item><title>Tales from the Scrum: No esperemos a Superman</title><link>http://msmvps.com/blogs/lopez/archive/2009/10/24/tales-from-the-scrum-no-esperemos-a-superman.aspx</link><pubDate>Sat, 24 Oct 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1734776</guid><dc:creator>lopez</dc:creator><description>&lt;p&gt;&lt;img style="display:inline;margin:0px 20px 20px 0px;" src="http://www.todocontenidos.com/images/articles/superman01.png" align="left" alt="" /&gt; En estos días, buscando ejemplos de antipatrones de Scrum, me encuentro con el “&lt;a href="http://scrumisscrum.wordpress.com/2009/04/02/hero-driven-development/" target="_blank"&gt;Hero-Driven Development&lt;/a&gt;” (visiten todo el blog &lt;a href="http://scrumisscrum.wordpress.com/" target="_blank"&gt;Scrum is Scrum&lt;/a&gt;). Hace poco comentaba sobre las “prima donnas” en desarrollo en &lt;a title="Tales from the Scrum- No somos Q" href="http://msmvps.com/blogs/lopez/archive/2009/10/22/tales-from-the-scrum-no-somos-q.aspx"&gt;Tales from the Scrum- No somos Q&lt;/a&gt;. El caso que quiero comentar ahora, es distinto. El desarrollador super héroe de nuestra historia, puede ser un tipo apreciado, querido por el equipo, reconocido en su campo. Es uno de esos desarrolladores que puede programar mucho más que los demás. Steve Mc Connell los llama &lt;a title="10X Developers" href="http://go2.wordpress.com/?id=725X1342&amp;amp;site=scrumisscrum.wordpress.com&amp;amp;url=http%3A%2F%2Fforums.construx.com%2Fblogs%2Fstevemcc%2Farchive%2F2008%2F03%2F27%2Fproductivity-variations-among-software-developers-and-teams-the-origin-of-quot-10x-quot.aspx"&gt;10X Developers&lt;/a&gt;. Pero puede causar problemas. Veamos (basado en el blog que mencioné):&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problema&lt;/strong&gt;: En el medio del desarrollo, surge un problema. Puede ser una configuración de Windows Communication Foundation, un tema de mapeo de Hibernate, una instalación en JBoss. No importa. El problema es complejo, y bastante técnico. De pronto, se abre la ventana, y entra nuestro “programador héroe”, reluciente en su traje. Se sienta, mira el código, entiende el problema, y lo va solucionando. El equipo, arrobado, se queda atrás, mirando, cómo nuestro Superman del código, va resolviendo el más intricado nudo de desarrollo. El héroe, concentrado, no habla ni explica. Parece relajado, lo que hace es “pan comido” para él. Entonces, en un momento, para, el problema está solucionado, levanta la vista, mira al equipo, y sale volando por la ventana, directo hacia el atardecer. Gran música de fondo.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Contexto&lt;/strong&gt;: El equipo no sabe cómo solucionar el problema técnico que surgió. Es algo en lo que tienen poca experiencia. Trataron de solucionarlo, pero no pudieron, y están entrando en pánico. Pasan las horas, y no avanzan. Todo está empantanado. Entonces, encienden la señal, para llamar al super héroe.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Fuerzas&lt;/strong&gt;: Vivimos en tiempos de cumplir los compromisos que asumimos para la iteración. Queda poco tiempo para la entrega. Todo indica que necesitamos una solución rápida.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Solución&lt;/strong&gt;: No hay que buscar solución rápida. Primero, habría que haber previsto el riesgo tecnológico, desde el propio equipo. Los miembros deberían haber anotado que en algún momento se toparían con una tecnología que no conocen, y tendrían que haber tomado la tarea asignándole más tiempo. Pero bueno, supongamos que no se pudo hacer eso. El problema de arriba, es que el equipo delega la solución FUERA del equipo. El equipo, de alguna forma, “se lava las manos”. La actitud del superhéroe también conspira para eso. No es ése el camino. El equipo no debería perder “ownership”, propiedad y responsabilidad del producto, y de cada pequeño o gran problema. El desarrollador super héroe, que los hay, debería haberse integrado al equipo, compartiendo su conocimiento. Debería actuar como consultor del resto del equipo, pero trabajando con él. Y cada cosa que haga, con el equipo, será considerada como cualquier otra tarea de otro miembro: deberá cumplir con los estilos pactados, las métricas adoptadas, la definición de “hecho”. No debe ser un miembro “distinguido”. Lo que haga, debe estar público y lo más entendible posible para el resto del equipo. Tal vez no consigamos una solución tan rápida como la de arriba. Pero seguramente, a largo plazo, estaremos construyendo un equipo más responsable.&lt;/p&gt;  &lt;p&gt;Recuerden: uno de los grandes entregables, en Scrum, es el equipo.&lt;/p&gt;  &lt;p&gt;Nos leemos!&lt;/p&gt;  &lt;p&gt;Angel “Java” Lopez   &lt;br /&gt;&lt;a href="http://www.ajlopez.com"&gt;http://www.ajlopez.com&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://twitter.com/ajlopez"&gt;http://twitter.com/ajlopez&lt;/a&gt;&lt;/p&gt;</description></item><item><title>VAN sobre Boo con Rodolfo Finochietti</title><link>http://msmvps.com/blogs/lopez/archive/2009/10/23/van-sobre-boo-con-rodolfo-finochietti.aspx</link><pubDate>Fri, 23 Oct 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1734501</guid><dc:creator>lopez</dc:creator><description>&lt;p&gt;&lt;img style="display:inline;margin:0px 20px 20px 0px;" src="http://www.todocontenidos.com/images/articles/boo01.png" align="left" alt="" /&gt; Vuelven las VAN (Reuniones Virtuales) de ALT.NET Hispano. La próxima, es este sábado 24 de Octubre, a las 18:00 GMT/UTC (Greenwich) (En Buenos Aires, con GMT-3, serían las 3 de la tarde). El tema será, principalmente, &lt;a href="http://boo.codehaus.org/" target="_blank"&gt;el lenguaje Boo&lt;/a&gt;, a cargo del bueno de &lt;a href="http://weblogs.shockbyte.com.ar/" target="_blank"&gt;Rodolfo Finochietti&lt;/a&gt; (&lt;a href="http://twitter.com/rodolfof"&gt;@rodofof&lt;/a&gt;).&lt;/p&gt;  &lt;p&gt;Pueden ver detalles en&lt;/p&gt;  &lt;p&gt;&lt;a href="http://groups.google.com/group/altnet-hispano/browse_thread/thread/dab63bbb407c3822?hl=es" target="_blank"&gt;VAN sobre Boo con Rodolfo Finochietti, Sábado 24 de Octubre&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Será en parte, continuación de la anterior&lt;/p&gt;  &lt;p&gt;&lt;a title="Alt.NET Hispano- VAN con Martín Salías y lenguajes en .NET" href="http://msmvps.com/blogs/lopez/archive/2009/10/01/alt-net-hispano-van-con-mart-237-n-sal-237-as-y-lenguajes-en-net.aspx"&gt;Alt.NET Hispano- VAN con Martín Salías y lenguajes en .NET&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Pueden ver el video resultado de esa anterior reunión en:&lt;/p&gt;  &lt;p&gt;&lt;a title="Virtual ALT.NET sobre Lenguajes" href="http://blog.salias.com.ar/2009/10/virtual-altnet-sobre-lenguajes.html"&gt;Virtual ALT.NET sobre Lenguajes&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Son todos temas como los que tratamos en algún TechNight de Buenos Aires, el año pasado: &lt;a title="lenguajes de programación e implementaciones en .NET" href="http://msmvps.com/blogs/lopez/archive/2008/10/16/babel-de-lenguajes-en-net.aspx"&gt;lenguajes de programación e implementaciones en .NET&lt;/a&gt; (ahí dejé bastantes enlaces sobre los temas que ahora están siendo actualizados en esta serie de VANs).&lt;/p&gt;  &lt;p&gt;Según adelanta Rodolfo, el tema será:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Básicamente mi exposición se va a centrar en porque me gusta Boo. Todos los lenguajes estáticos en .NET son bastante similares (con el DLR esto cambio un poco), y esto creo yo tiene una razón que voy a explicar en el charla. En cambio Boo no se parece un lenguaje .NET. Su diseñador (Rodrigo De Oliveira) lo creo como un herramientas que le facilita la construcción de aplicaciones. &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Resumiendo: Voy a hacer una intro al diseño de lenguajes estáticos en .NET y después me voy a centrar en Boo y sus características. &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Recuerden:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Si no conocen qué es una reunión VAN, pueden consultar &lt;/em&gt;&lt;a href="http://www.zachariahyoung.com/zy/post/2009/01/Introduction-to-Virtual-ALTNET.aspx"&gt;&lt;em&gt;VAN meetings&lt;/em&gt;&lt;/a&gt;&lt;em&gt;. Para ver cómo se desarrolla una VAN de ALT.NET Hispano, y qué software necesitan para asistir, ver &lt;/em&gt;&lt;a href="http://altnet-hispano.pbworks.com/Descripcion-de-Reuniones-VAN"&gt;&lt;em&gt;Descripcion-de-Reuniones-VAN&lt;/em&gt;&lt;/a&gt;&lt;em&gt;. Pueden ver &lt;/em&gt;&lt;a href="http://altnet-hispano.pbworks.com/Historial-de-reuniones"&gt;&lt;em&gt;el historial de anteriores reuniones VAN&lt;/em&gt;&lt;/a&gt;&lt;em&gt; (visiten las que dieron, por ejemplo, sobre NHibernate, WPF y demás) (yo ya participé en &lt;/em&gt;&lt;a href="http://msmvps.com/blogs/lopez/archive/2009/09/18/resultado-de-la-van-en-alt-net-hispano-sobre-scrum.aspx"&gt;&lt;em&gt;VAN sobre Scrum&lt;/em&gt;&lt;/a&gt;&lt;em&gt; y en otra &lt;/em&gt;&lt;a href="http://msmvps.com/blogs/lopez/archive/2009/09/25/van-reuni-243-n-virtual-en-alt-net-hispano-sobre-generaci-243-n-de-c-243-digo.aspx"&gt;&lt;em&gt;sobre generación de código&lt;/em&gt;&lt;/a&gt;&lt;em&gt;, que quedará publicada en estos días). Supongo (pero confirmen) que la URL de entrada de la VAN de Martín será &lt;/em&gt;&lt;a href="http://snipr.com/virtualaltnet"&gt;&lt;em&gt;http://snipr.com/virtualaltnet&lt;/em&gt;&lt;/a&gt;&lt;em&gt;. Cualquier cosa, pueden consultar &lt;/em&gt;&lt;a href="http://groups.google.com/group/altnet-hispano/"&gt;&lt;em&gt;la lista de correo de ALT.NET Hispano&lt;/em&gt;&lt;/a&gt;&lt;em&gt;. También pueden suscribirse para proponer nuevos temas, y colaborar con la comunidad.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Visiten &lt;a href="http://boo.codehaus.org/" target="_blank"&gt;el sitio de Boo&lt;/a&gt; si quieren averiguar más sobre el lenguaje, y lean &lt;a href="http://www.google.com/url?q=http://boo.codehaus.org/BooManifesto.pdf&amp;amp;ei=n9rgSpPkKNOh8AbEqc2eDQ&amp;amp;sa=X&amp;amp;oi=nshc&amp;amp;resnum=1&amp;amp;ct=result&amp;amp;cd=1&amp;amp;ved=0CAsQzgQoAA&amp;amp;usg=AFQjCNFakzlVrlPRdxPt-ENYggy1Y8Af4g" target="_blank"&gt;el Boo Manifesto&lt;/a&gt;. Tomé la imagen del blog &lt;a title="http://blogs.codehaus.org/people/bamboo/archives/boo.html" href="http://blogs.codehaus.org/people/bamboo/archives/boo.html"&gt;http://blogs.codehaus.org/people/bamboo/archives/boo.html&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Nos leemos!&lt;/p&gt;  &lt;p&gt;Angel “Java” Lopez   &lt;br /&gt;&lt;a href="http://www.ajlopez.com"&gt;http://www.ajlopez.com&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://twitter.com/ajlopez"&gt;http://twitter.com/ajlopez&lt;/a&gt;&lt;/p&gt;</description></item><item><title>dynamic and indexer</title><link>http://msmvps.com/blogs/matthieu/archive/2009/10/21/dynamic-and-indexer.aspx</link><pubDate>Wed, 21 Oct 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1734061</guid><dc:creator>Matthieu MEZIL</dc:creator><description>&lt;p&gt;Remember &lt;a href="http://msmvps.com/blogs/matthieu/archive/2008/10/27/c-4-dynamic-keyword.aspx" target="_blank"&gt;one year ago, I wrote a post on how to use reflection with dynamic keyword&lt;/a&gt;. At this moment, I sent an email to MS to add an indexer in dynamic. I don’t know if my email changed any thing but I am very happy to see that from .NET 4.0 Beta 2, we are now able to use it.&lt;/p&gt;  &lt;p&gt;So in my sample, instead of &lt;/p&gt;  &lt;p&gt;result = dynamicSpBase.get_Item(name);&lt;/p&gt;  &lt;p&gt;I can now directly write this: &lt;/p&gt;  &lt;p&gt;result = dynamicSpBase[name];&lt;/p&gt;  &lt;p&gt;Great! &lt;img src="http://msmvps.com/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;/p&gt;</description></item><item><title>Running .NET 1.1 Applications On .NET 2.0</title><link>http://msmvps.com/blogs/paulomorgado/archive/2009/10/20/running-net-1-1-applications-on-net-2-0.aspx</link><pubDate>Tue, 20 Oct 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1733546</guid><dc:creator>paulo</dc:creator><description>&lt;p align="justify"&gt;One of the applications I develop is a &lt;a title="Microsoft .NET Framework" href="https://www.microsoft.com/net/" target="_blank"&gt;.NET&lt;/a&gt; 1.1 &lt;a title="The Official Microsoft WPF and Windows Forms Site" href="http://windowsclient.net/" target="_blank"&gt;Windows Forms&lt;/a&gt; application used by more than 5000 users and critical for the business.&lt;/p&gt;  &lt;p align="justify"&gt;Being a complex and critical application, porting it to the 2.0 runtime just because it was not an option because it would mean installing the new runtime and framework on the stable environment of the workstations (&lt;a title="Microsoft Windows" href="http://cli.gs/Microsoft-Windows" target="_blank"&gt;&lt;/a&gt;&lt;a title="Microsoft Windows XP" href="http://www.microsoft.com/windows/windows-xp/" target="_blank"&gt;Windows XP&lt;/a&gt;&lt;/a&gt;) and test fully the application. That was not an option.&lt;/p&gt;  &lt;p align="justify"&gt;As time went by, a developer received a brand new laptop with &lt;a title="Microsoft Windows Vista" href="https://www.microsoft.com/windows/windows-vista/" target="_blank"&gt;Windows Vista&lt;/a&gt;. Since he only needed ,NET 2.0 for his developments, he never installed .NET 1.1.&lt;/p&gt;  &lt;p align="justify"&gt;Another developer on my team had already tried to port the application to .NET 2.0 and run into some issues:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div align="justify"&gt;The main component of this application is the &lt;a title="WebBrowserControl for the .NET Framework 1.1" href="http://www.codeproject.com/KB/miscctrl/WebBrowserControl11.aspx" target="_blank"&gt;Web Browser Control&lt;/a&gt;. This control derives from &lt;a title="AxHost Class" href="http://msdn.microsoft.com/library/system.windows.forms.axhost.aspx" target="_blank"&gt;AxHost&lt;/a&gt;, which changed going from 1.1 to 2.0 and needed major changes to compile for the 2.0 framework.&lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div align="justify"&gt;Another change was that mixing synchronous and asynchronous calls is not allowed in the 2.0 framework and we had, at least, one of those in our use of &lt;a title="HttpWebRequest Class" href="http://msdn.microsoft.com/library/system.net.httpwebrequest.aspx" target="_blank"&gt;HttpWebRequest&lt;/a&gt;/&lt;a title="HttpWebResponse Class" href="http://msdn.microsoft.com/library/system.net.httpwebresponse.aspx" target="_blank"&gt;HttpWebResponse&lt;/a&gt;.&lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p align="justify"&gt;The .NET 2.0 runtime and frameworks were developed to be highly compatible with applications written and compiled to the 1.1 runtime and frameworks. In fact, some of the changes were just applying the &lt;a title="ObsoleteAttribute Class" href="http://msdn.microsoft.com/library/system.obsoleteattribute.aspx" target="_blank"&gt;ObsoleteAttribute&lt;/a&gt; set to throw a compiler error when used, which doesn’t prevent its use by already compiled assemblies. This was the case of the WebBrowserControl/AxHost and just using the assembly compiled for .NET 1.1 would probably run fine. And it did.&lt;/p&gt;  &lt;p align="justify"&gt;The synchronous/asynchronous was also very easy to fix. All it took was changing this:&lt;/p&gt;  &lt;p style="padding-left:2em;" align="left"&gt;&lt;font face="Consolas"&gt;request.GetRequestStream()&lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;into this:&lt;/p&gt;  &lt;p style="padding-left:2em;" align="left"&gt;&lt;font face="Consolas"&gt;request.EndGetRequestStream(response.BeginGetRequestStream(null, null))&lt;/font&gt;&lt;/p&gt;  &lt;p align="justify"&gt;And it all worked as if it was running on .NET 1.1.&lt;/p&gt;  &lt;p&gt;But that’s not the end of it. Latter came a requirement to use, in one of the web pages that ran in the web browser control, an ActiveX component developed in .NET 2.0.&lt;/p&gt;  &lt;p&gt;But that time, the 2.0 runtime and framework were already installed on the workstations.&lt;/p&gt;  &lt;p&gt;But how would we force the application to run in the 2.0 runtime if the 1.1 runtime was still there?&lt;/p&gt;  &lt;p&gt;As simple as adding this to the configuration file (App.config):&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;configuration&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;startup&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;requiredRuntime &lt;/span&gt;&lt;span style="color:red;"&gt;version&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;v2.0.50727&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;safemode&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;true&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;/&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;startup&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;configuration&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;</description></item></channel></rss>