<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">kevinpilch-bisson's WebLog</title><subtitle type="html" /><id>http://blogs.msdn.com/kevinpilchbisson/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/kevinpilchbisson/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2007-11-22T21:53:51Z</updated><entry><title>I’m speaking at Seattle Code Camp this weekend.</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2008/11/13/i-m-speaking-at-seattle-code-camp-this-weekend.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2008/11/13/i-m-speaking-at-seattle-code-camp-this-weekend.aspx</id><published>2008-11-14T05:08:07Z</published><updated>2008-11-14T05:08:07Z</updated><content type="html">&lt;p&gt;This Saturday from 2:45-4:00 I’ll be giving a talk on “What’s coming up in VS2010 for C# Developers?”&amp;#160; at &lt;a target="_blank" href="https://seattle.codecamp.us/default.aspx"&gt;Seattle Code Camp&lt;/a&gt;.&amp;#160; I’ll mostly be showing off some of the new features we’ve been working on for VS2010, especially those related to the C# editor.&amp;#160; I’d love it if you stopped by!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9068195" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry><entry><title>Hotfix for VS2008 SP1 Available</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2008/10/30/hotfix-for-vs2008-sp1-available.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2008/10/30/hotfix-for-vs2008-sp1-available.aspx</id><published>2008-10-31T03:34:35Z</published><updated>2008-10-31T03:34:35Z</updated><content type="html">&lt;p&gt;In VS2008 SP1 our team added a significant new feature: live semantic analysis of open files (or “background squiggles” as we called it internally).&amp;#160; Unfortunately, soon after release we found a few small issues with the release.&amp;#160; They are:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Incorrect errors when you open a solution with breakpoints in .aspx.cs files. &lt;/li&gt;    &lt;li&gt;Incorrect errors regarding conversions of constants in rare cases. &lt;/li&gt;    &lt;li&gt;An issue importing metadata from some non-C# assemblies. &lt;/li&gt;    &lt;li&gt;Some timing issues where errors would appear and then disappear during typing or file/solution opening. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;We spent some time analyzing the issues, and we’ve come up with a hotfix to address them.&amp;#160; If you’re seeing any issues where you get live semantic errors that you don’t expect, please &lt;a target="_blank" href="http://code.msdn.microsoft.com/kb957259"&gt;download&lt;/a&gt; this fix and try it out.&lt;/p&gt;  &lt;p&gt;Let me know if you find any issues with it!&lt;/p&gt;  &lt;p&gt;Thanks!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9025610" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry><entry><title>CodeRush Xpress for C#</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2008/10/28/coderush-xpress-for-c.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2008/10/28/coderush-xpress-for-c.aspx</id><published>2008-10-28T21:13:07Z</published><updated>2008-10-28T21:13:07Z</updated><content type="html">&lt;p&gt;Yesterday at the PDC, &lt;a target="_blank" href="http://diditwith.net"&gt;Dustin&lt;/a&gt; announced the availability of &lt;a target="_blank" href="http://community.devexpress.com/blogs/markmiller/archive/2008/10/27/announcing-coderush-express-for-c.aspx"&gt;CodeRush Xpress for C#&lt;/a&gt;.&amp;#160; This is a &lt;strong&gt;&lt;em&gt;free&lt;/em&gt;&lt;/strong&gt; addin for VS 2008 that provides a whole bunch of fantastic editor productivity features.&amp;#160; &lt;a target="_blank" href="http://devexpress.com/CodeRushX"&gt;Download&lt;/a&gt; it today and give it a shot!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9020651" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry><entry><title>Removing elements from a Dictionary</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2008/10/27/removing-elements-from-a-dictionary.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2008/10/27/removing-elements-from-a-dictionary.aspx</id><published>2008-10-28T03:42:23Z</published><updated>2008-10-28T03:42:23Z</updated><content type="html">&lt;p&gt;The topic of removing elements from a dictionary came up recently on an internal mailing list.&amp;#160; Someone was iterating through all the elements of a collection and wanting to remove some of them. The problem with that is that modifying the collection underlying the enumerator throws.&amp;#160; He had the following pseudo code:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="400"&gt;         &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;void &lt;/span&gt;RemoveSomeElements(&lt;span style="color: #2b91af"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;, &lt;span style="color: blue"&gt;int&lt;/span&gt;&amp;gt; dict)
{
    &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;e &lt;span style="color: blue"&gt;in &lt;/span&gt;dict)
    {
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(e.Value &amp;lt; 35)
        {
            &lt;span style="color: green"&gt;// Remove e!
        &lt;/span&gt;}
    }
}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;Several people replied that he could just create a list of elements to be removed and then iterate that afterwards:&lt;/p&gt;

&lt;table border="1" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="400"&gt;
        &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;keysToRemove = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;();
&lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;e &lt;span style="color: blue"&gt;in &lt;/span&gt;dict)
{
    &lt;span style="color: blue"&gt;if &lt;/span&gt;(e.Value &amp;lt; 35)
    {
        keysToRemove.Add(e.Key);
    }
}

&lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;key &lt;span style="color: blue"&gt;in &lt;/span&gt;keysToRemove)
{
    dict.Remove(key);
}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;That works, but it’s pretty verbose.&amp;#160; Someone suggested a more functional way to do it that’s pretty nice:&lt;/p&gt;

&lt;table border="1" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="400"&gt;
        &lt;pre class="code"&gt;dict.ToList().Where(pair =&amp;gt; pair.Value &amp;lt; 35).ToList().ForEach(pair =&amp;gt; dict.Remove(pair.Key));&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;At this point I decided to show off, and make it more efficient by using an “Apply” extension method instead of the .ForEach method that shipped on List&amp;lt;T&amp;gt; in .Net 2.0.&amp;#160; I came up with this:&lt;/p&gt;

&lt;table border="1" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="400"&gt;
        &lt;pre class="code"&gt;dict.Where(pair =&amp;gt; pair.Value &amp;lt; 35).Apply(pair =&amp;gt; dict.Remove(pair.Key)).Apply();&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Along with the code to Apply:&lt;/p&gt;

&lt;table border="1" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="400"&gt;
        &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public static class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ApplyExtensions
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;public static &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;T&amp;gt; Apply&amp;lt;T&amp;gt;(&lt;span style="color: blue"&gt;this &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;T&amp;gt; source, &lt;span style="color: #2b91af"&gt;Action&lt;/span&gt;&amp;lt;T&amp;gt; action)
    {
        &lt;span style="color: #2b91af"&gt;Argument&lt;/span&gt;.NotNull(source, () =&amp;gt; () =&amp;gt; source);
        &lt;span style="color: #2b91af"&gt;Argument&lt;/span&gt;.NotNull(action, () =&amp;gt; () =&amp;gt; action);
        &lt;span style="color: blue"&gt;return &lt;/span&gt;ApplyInternal(source, action);
    }

    &lt;span style="color: blue"&gt;internal static &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;T&amp;gt; ApplyInternal&amp;lt;T&amp;gt;(&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;T&amp;gt; source, &lt;span style="color: #2b91af"&gt;Action&lt;/span&gt;&amp;lt;T&amp;gt; action)
    {
        &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;e &lt;span style="color: blue"&gt;in &lt;/span&gt;source)
        {
            action(e);
            &lt;span style="color: blue"&gt;yield return &lt;/span&gt;e;
        }
    }

    &lt;span style="color: blue"&gt;public static void &lt;/span&gt;Apply&amp;lt;T&amp;gt;(&lt;span style="color: blue"&gt;this &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;T&amp;gt; source)
    {
        &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;e &lt;span style="color: blue"&gt;in &lt;/span&gt;source)
        {
            &lt;span style="color: green"&gt;// do nothing, just make sure the elements are enumerated.
        &lt;/span&gt;}
    }

}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;Here I thought I was doing right by C# 3.0, and showing people how to use lazily chained iterators.&amp;#160; Unfortunately, this code drops us right back to the original problem!&amp;#160; Because of lazy iteration, we’re actually still iterating the dictionary when we try to remove the elements, and so we invalidate the first iterator in our chain.&amp;#160; &lt;/p&gt;

&lt;p&gt;It’s a simple fix, but still a reminder that the semantics of delayed execution can be tricky to reason about sometimes:&lt;/p&gt;

&lt;table border="1" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="400"&gt;
        &lt;pre class="code"&gt;dict.Where(pair =&amp;gt; pair.Value &amp;lt; 35).ToArray().Apply(pair =&amp;gt; dict.Remove(pair.Key)).Apply();&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;The “&lt;strong&gt;ToArray”&lt;/strong&gt; call finishes the iteration of the dictionary, but uses less space than the original “.ForEach” solution, since we only realize a collection of the elements to be removed, instead of all of the elements in the dictionary.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9019515" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry><entry><title>ArgumentNullException and refactoring</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2008/10/27/argumentnullexception-and-refactoring.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2008/10/27/argumentnullexception-and-refactoring.aspx</id><published>2008-10-27T17:58:51Z</published><updated>2008-10-27T17:58:51Z</updated><content type="html">&lt;p&gt;I hate using strings to represent program elements!&amp;#160; One of the big problems is that it hinders automated refactoring.&amp;#160; Strings don’t have any semantic meaning, so refactoring tools don’t know which references to the string need to be updated.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;While playing with expression trees, a while ago I came up with this:&lt;/p&gt;  &lt;table border="1" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="400"&gt;         &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public static class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Argument
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;public static void &lt;/span&gt;NotNull(&lt;span style="color: blue"&gt;object &lt;/span&gt;value, &lt;span style="color: #2b91af"&gt;Expression&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;&amp;gt;&amp;gt; arg)
    {
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(value == &lt;span style="color: blue"&gt;null&lt;/span&gt;)
        {
            &lt;span style="color: blue"&gt;var &lt;/span&gt;body1 = (&lt;span style="color: #2b91af"&gt;Expression&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;object&lt;/span&gt;&amp;gt;&amp;gt;)arg.Body;
            &lt;span style="color: blue"&gt;var &lt;/span&gt;body2 = (&lt;span style="color: #2b91af"&gt;MemberExpression&lt;/span&gt;)body1.Body;
            &lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ArgumentNullException&lt;/span&gt;(body2.Member.Name);
        }

    }
}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;You can use this for argument validation like this:&lt;/p&gt;

&lt;table border="1" cellspacing="0" cellpadding="2" width="400"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td valign="top" width="400"&gt;
        &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;static void &lt;/span&gt;Main(&lt;span style="color: blue"&gt;string&lt;/span&gt;[] args)
{
    &lt;span style="color: #2b91af"&gt;Argument&lt;/span&gt;.NotNull(args, () =&amp;gt; () =&amp;gt; args);
}&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;This looks a little strange, but has some interesting properties:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;There are no strings, which means that refactoring tools “Just Work” and update all references. &lt;/li&gt;

  &lt;li&gt;The majority of the reflection code happens only in the exception code, which means that this has significantly better performance than my first attempt (which took just an “Expression&amp;lt;Func&amp;lt;object&amp;gt;&amp;gt;” &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On the other hand it has some drawbacks too:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The calling side looks a little strange with “() =&amp;gt; () =&amp;gt;'” &lt;/li&gt;

  &lt;li&gt;Using this approach will lead to a LOT of compiler generated display classes to store the parameter references. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I’m not sure I would use this in production code, but it was an interesting exercise to come up with a way of validating parameters that doesn’t involve strings.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;What do you think?&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9018324" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry><entry><title>Virtualization Update</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2008/10/27/virtualization-update.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2008/10/27/virtualization-update.aspx</id><published>2008-10-27T17:38:08Z</published><updated>2008-10-27T17:38:08Z</updated><content type="html">&lt;p&gt;Just a quick update.&amp;#160; After my &lt;a href="http://blogs.msdn.com/kevinpilchbisson/archive/2008/08/15/getting-on-the-virtualization-bandwagon.aspx"&gt;previous&lt;/a&gt; post, I actually stopped using virtualization for most cases, since I found the performance hit to be too significant.&amp;#160; While the automation I mentioned before still doesn’t support HyperV, I hand built a couple of VM’s with it and I have to say that I’m quite impressed.&amp;#160; &lt;/p&gt;  &lt;p&gt;On my host machine, it takes about 8 minutes to do a clean build of the code I usually work on.&amp;#160; With my previous virtual machine, it took about 32 minutes!&amp;#160; I think this happened because while my host machine has 4 processors, the VM can only access one of those.&amp;#160; I wasn’t willing to pay that price.&amp;#160; With HyperV today it takes about 9.5 minutes, and I &lt;em&gt;am&lt;/em&gt; willing to pay that price for the added flexibility and the time I can save installing builds.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9018289" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry><entry><title>Getting on the virtualization bandwagon</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2008/08/15/getting-on-the-virtualization-bandwagon.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2008/08/15/getting-on-the-virtualization-bandwagon.aspx</id><published>2008-08-15T17:55:46Z</published><updated>2008-08-15T17:55:46Z</updated><content type="html">&lt;p&gt;Lately I've been trying to support work happening in a variety of our development branches, and that's been challenging to the two machine setup I mentioned &lt;a href="http://blogs.msdn.com/kevinpilchbisson/archive/2007/11/24/dodfooding-challenges-part-one.aspx"&gt;here&lt;/a&gt;.&amp;nbsp; Visual Studio (unfortunately) takes a &lt;strong&gt;long&lt;/strong&gt; time to install and uninstall.&amp;nbsp; Also during our development cycle uninstall is sometimes broken.&amp;nbsp; That means that people often re-image (at least) their test machines whenever they need to install a new build of Visual Studio.&lt;/p&gt; &lt;p&gt;In order to do work in three different branches somewhat simultaneously, I need to have test machines that have those three different branches installed.&amp;nbsp; It wasn't reasonable to re-image and re-install my single test machine every time I needed to switch branches.&amp;nbsp; It's also not very cost effective for me to have 3 test machines where two of them spend the vast majority of their time idle, not to mention that this doesn't scale well if one day I need a 4th branch.&lt;/p&gt; &lt;p&gt;So last week, I jumped on the virtualization bandwagon.&amp;nbsp; I flattened my best machine, installed windows server 2008 64-bit*, and started using virtual machines for my test machines.&amp;nbsp; So far it's been working out very well for me, but I do have to give credit to some other people.&amp;nbsp; A few people in our test group have written some automation around Virtual Server to make life easy for people wanting to use virtual machines.&amp;nbsp; They have some software that manages creating VMs for you.&amp;nbsp; It basically does the following steps:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Pull an image of a selected OS from the network, and cache it locally.&lt;/li&gt; &lt;li&gt;Create a VM&lt;/li&gt; &lt;li&gt;Install the OS&lt;/li&gt; &lt;li&gt;Add it to the corporate network domain&lt;/li&gt; &lt;li&gt;Install the latest set of Windows Updates&lt;/li&gt; &lt;li&gt;Add my domain account to the Administrators group.&lt;/li&gt; &lt;li&gt;Optionally run a custom script to install more software.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;For step 7, this group has provided stock scripts for installing various versions of Visual Studio, and one to install the latest build from a selected branch.&amp;nbsp; It's really convenient, since steps 2 to 6 only take about 25 minutes (and step 1 is usually skipped because the image is in the usually in your local cache).&lt;/p&gt; &lt;p&gt;They also have an option to have the VM be destroyed and re-created every night, which means that you can come in to work in the morning and have a fresh test machine with the latest build on it.&lt;/p&gt; &lt;p&gt;So, I started out need to have 3 test machines in 3 different branches, but the system is so easy to use that I've already built up a larger set than that.&amp;nbsp; My current list of virtual machines is:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;VS2008 without SP1&lt;/li&gt; &lt;li&gt;VS2008 with SP1.&lt;/li&gt; &lt;li&gt;A debug build of VS from each of the 3 branches I mentioned above.&lt;/li&gt; &lt;li&gt;A release build of VS from the branch I normally work in for performance testing (I don't need absolute numbers, just finding the hotspots).&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;My only wish is that they update it to take advantage of Hyper-V soon to improve performance of the hosted machines.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;* I previously had Vista 32-bit on the machine because at the time I set it up Server 2008 wasn't released yet, and there was a bug in the interim builds of visual studio that made install fail on 64-bit machines.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8869818" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry><entry><title>Where has Kevin been?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2008/02/14/where-has-kevin-been.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2008/02/14/where-has-kevin-been.aspx</id><published>2008-02-15T01:55:25Z</published><updated>2008-02-15T01:55:25Z</updated><content type="html">&lt;p&gt;I'm still here, I've just been very busy.&amp;#160; We're in the thick of planning out what we'd like to do for the next version of Visual Studio.&amp;#160; If you have any suggestions, please drop them in the comments section.&amp;#160; I'm &lt;em&gt;most&lt;/em&gt; interested in the sorts of features that would be Visual Studio features (as opposed to language features), and the ones that apply while you are actually editing C# code.&lt;/p&gt;  &lt;p&gt;Also, I've changed roles a bit.&amp;#160; I'm now the dev lead for the C# IDE team, instead of an individual contributor on the team, so I'm learning what it's like to be a people manager.&lt;/p&gt;  &lt;p&gt;I have a few ideas queued up for future blog posts, but I'm definitely interested in your questions too.&amp;#160; What parts of features in the C# editor are you curious about?&amp;#160; What about work at MS and our processes, is that a topic of any interest?&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7702397" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry><entry><title>Kirill on Named Parameters</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2007/12/28/kirill-on-named-parameters.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2007/12/28/kirill-on-named-parameters.aspx</id><published>2007-12-29T00:33:00Z</published><updated>2007-12-29T00:33:00Z</updated><content type="html">&lt;p&gt;My colleague Kirill mentioned a post he had about &lt;a href="http://kirillosenkov.blogspot.com/2007/11/jacob-carpenter-on-named-arguments-in-c.html"&gt;named parameters&lt;/a&gt;, but I thought I would pull it up out of the comments, because I think it's pretty interesting.&amp;#160; It's similar to a system I've been using to simplify writing data classes that I'll get up here one of these days.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6888803" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry><entry><title>More on "bools, structs or enums"</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2007/12/10/more-on-bools-structs-or-enums.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2007/12/10/more-on-bools-structs-or-enums.aspx</id><published>2007-12-10T20:16:00Z</published><updated>2007-12-10T20:16:00Z</updated><content type="html">&lt;P&gt;There were some points about my previous post that I thought it might be worth bringing up in a new entry.&amp;nbsp; It seems that in general, most people agree that the set of bool parameters are a bad idea.&amp;nbsp; I found this a little surprising, given how often I've seen it.&amp;nbsp; Maybe it's just the code-bases I've inherited :)&lt;/P&gt;
&lt;H2&gt;Fluent Interfaces&lt;/H2&gt;
&lt;P&gt;Someone pointed out that an alternative to using object initializers from C# 3.0 is to use &lt;A href="http://www.martinfowler.com/bliki/FluentInterface.html" mce_href="http://www.martinfowler.com/bliki/FluentInterface.html"&gt;Fluent Interfaces&lt;/A&gt;.&amp;nbsp; Indeed, this is exactly what I would have done before object initializers were around.&amp;nbsp; Jay and I have been talking about the idea of Fluent Interfaces and how they relate to "builder" classes&amp;nbsp; for &lt;A href="http://jbazuzi.blogspot.com/2007/11/immutable-data-class-generator-it-lives.html" mce_href="http://jbazuzi.blogspot.com/2007/11/immutable-data-class-generator-it-lives.html"&gt;data classes&lt;/A&gt; for more than a year now.&lt;/P&gt;
&lt;P&gt;Here's an example of how a Fluent Interface might be used instead of a collection initializer in the previous blog entry's context&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=10 width=400 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=400&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;struct&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(43,145,175)"&gt;DisplayUserOptions
&lt;/SPAN&gt;{
    &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;bool&lt;/SPAN&gt; email;
    &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;bool&lt;/SPAN&gt; phoneNumber;
    &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(43,145,175)"&gt;DisplayUserOptions&lt;/SPAN&gt; SetEmail(&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;bool&lt;/SPAN&gt; yes) { email = yes; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;this&lt;/SPAN&gt;; }
    &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(43,145,175)"&gt;DisplayUserOptions&lt;/SPAN&gt; SetPhoneNumber(&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;bool&lt;/SPAN&gt; yes) { phoneNumber = yes; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;this&lt;/SPAN&gt;; }
}&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And it can be called inline in a way similar to the object initializer syntax:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=10 width=400 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=400&gt;&lt;PRE class=code&gt;DisplayUser(user, &lt;SPAN style="COLOR: rgb(43,145,175)"&gt;Console&lt;/SPAN&gt;.Out, &lt;SPAN style="COLOR: rgb(0,0,255)"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: rgb(43,145,175)"&gt;DisplayUserOptions&lt;/SPAN&gt;().SetEmail(&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;true&lt;/SPAN&gt;).SetPhoneNumber(&lt;SPAN style="COLOR: rgb(0,0,255)"&gt;false&lt;/SPAN&gt;));&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;
&lt;H2&gt;Extensibility&lt;/H2&gt;
&lt;P&gt;Numerous people pointed that both the enum and the struct option produce more extensible API's than passing bools.&amp;nbsp; In general I consider myself more of an application writer than a library writer, and so I tend not to worry as much about extensibility.&amp;nbsp; This doesn't mean that I feel like I don't need to think about whether an API is usable or not, but rather that I don't tend to worry about changes that require me to recompile dependent assemblies.&amp;nbsp; However, this does bring up a separate point.&amp;nbsp; When I do code reviews I like them to contain meaningful changes, and so it's nice that with either the the enum or struct option the only places that change are the options type itself, and &lt;EM&gt;the callers who care about the new option. &lt;/EM&gt;Conversely, with the bool option, &lt;EM&gt;all&lt;/EM&gt; callers need to be updated.&lt;/P&gt;
&lt;H2&gt;Extension methods for &lt;EM&gt;enums&lt;/EM&gt;&lt;/H2&gt;
&lt;P&gt;I said in my previous post that one of the advantages of using structs is that it gives you a place to group behavior that belongs with the options.&amp;nbsp; Someone pointed out to me that with C# 3.0, you can use extension methods to add functionality to your enums.&amp;nbsp; This is a good point.&amp;nbsp; I'll have to think more in the future about whether I feel comfortable using an enum together with some extension methods, as opposed to a struct or class.&lt;/P&gt;
&lt;P&gt;Thanks for the great feedback!&amp;nbsp; Keep it coming.&lt;/P&gt;
&lt;P&gt;EDIT: Added an example of a Fluent Interface for this scenario.&lt;/P&gt;
&lt;P&gt;EDIT 2: Fix the implementation of the Set methods in the example.&amp;nbsp; Thanks Jay!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;EDIT 3: Change section header to be "extension methods for enums", instead of "Extension methods for interfaces".&amp;nbsp; Oops&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6725625" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry><entry><title>Coding Styles: bools, structs, or enums?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2007/11/30/coding-styles-bools-structs-or-enums.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2007/11/30/coding-styles-bools-structs-or-enums.aspx</id><published>2007-11-30T20:36:25Z</published><updated>2007-11-30T20:36:25Z</updated><content type="html">&lt;p&gt;I often find myself writing or consuming API's which require the caller to specify some sort of options.&amp;#160; I've seen numerous ways to specify those options, but I've yet to find one that I really like.&amp;#160; Let's work with an example throughout the rest of this post.&amp;#160; Imagine we're working on an application which has some notion of a User.&amp;#160; We're now about to create a function to output a User to a Stream.&amp;#160; We want to provide two options:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Should we include the User's email address? &lt;/li&gt;    &lt;li&gt;Should we include the User's phone number? &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;I can imagine several ways of designing this API.&amp;#160; First, we could use a couple of bool parameters, like this:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;#160;&lt;/p&gt;    &lt;table cellspacing="0" cellpadding="10" width="400" border="1"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td valign="top" width="400"&gt;           &lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; DisplayUser(&lt;span style="color: rgb(43,145,175)"&gt;User&lt;/span&gt; user, &lt;span style="color: rgb(43,145,175)"&gt;TextWriter&lt;/span&gt; stream, &lt;span style="color: rgb(0,0,255)"&gt;bool&lt;/span&gt; displayEmail, &lt;span style="color: rgb(0,0,255)"&gt;bool&lt;/span&gt; displayPhoneNumber)&lt;/pre&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/blockquote&gt;

&lt;p&gt;Next, we could use a flags enum to represent the options, like this:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;table cellspacing="0" cellpadding="10" width="400" border="1"&gt;&lt;tbody&gt;
      &lt;tr&gt;
        &lt;td valign="top" width="400"&gt;
          &lt;pre class="code"&gt;[&lt;span style="color: rgb(43,145,175)"&gt;Flags&lt;/span&gt;]
&lt;span style="color: rgb(0,0,255)"&gt;enum&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;DisplayUserOptions
&lt;/span&gt;{
    Email = 0x1,
    PhoneNumber = 0x2,
    Both = (Email | PhoneNumber),
}
&lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; DisplayUser(&lt;span style="color: rgb(43,145,175)"&gt;User&lt;/span&gt; user, &lt;span style="color: rgb(43,145,175)"&gt;TextWriter&lt;/span&gt; stream, &lt;span style="color: rgb(43,145,175)"&gt;DisplayUserOptions&lt;/span&gt; options)&lt;/pre&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/blockquote&gt;

&lt;p&gt;Finally we could create a struct which contains two bools instead of the enum, like so:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;table cellspacing="0" cellpadding="10" width="400" border="1"&gt;&lt;tbody&gt;
      &lt;tr&gt;
        &lt;td valign="top" width="400"&gt;
          &lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;struct&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;DisplayUserOptions
&lt;/span&gt;{
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;bool&lt;/span&gt; Email;
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;bool&lt;/span&gt; PhoneNumber;
}&lt;/pre&gt;

          &lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; DisplayUser(&lt;span style="color: rgb(43,145,175)"&gt;User&lt;/span&gt; user, &lt;span style="color: rgb(43,145,175)"&gt;TextWriter&lt;/span&gt; stream, &lt;span style="color: rgb(43,145,175)"&gt;DisplayUserOptions&lt;/span&gt; options)&lt;/pre&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/blockquote&gt;

&lt;p&gt;I don't like passing the two bools, because I find that reading the callsite of a method designed like this to be difficult, because you don't know what the parameters mean anymore.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;table cellspacing="0" cellpadding="10" width="400" border="1"&gt;&lt;tbody&gt;
      &lt;tr&gt;
        &lt;td valign="top" width="400"&gt;
          &lt;pre class="code"&gt;DisplayUser(user, &lt;span style="color: rgb(43,145,175)"&gt;Console&lt;/span&gt;.Out, &lt;span style="color: rgb(0,0,255)"&gt;true&lt;/span&gt;, &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt;);&lt;/pre&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/blockquote&gt;

&lt;p&gt;Does this display the email address or the phone number?&amp;#160; I can't remember anymore.&amp;#160; I know that parameter help can tell you the names of the parameters, but that doesn't help when I'm doing a code review in windiff, since windiff doesn't have parameter help tool-tips yet.&lt;/p&gt;

&lt;p&gt;On my current team, we have a convention that when we call a method like this, we put the parameter name in a comment, so that we can see it, like:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;table cellspacing="0" cellpadding="10" width="400" border="1"&gt;&lt;tbody&gt;
      &lt;tr&gt;
        &lt;td valign="top" width="400"&gt;
          &lt;pre class="code"&gt;DisplayUser(user, &lt;span style="color: rgb(43,145,175)"&gt;Console&lt;/span&gt;.Out, &lt;span style="color: rgb(0,0,255)"&gt;true&lt;/span&gt; &lt;span style="color: rgb(0,128,0)"&gt;/*displayEmail*/&lt;/span&gt;, &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt; &lt;span style="color: rgb(0,128,0)"&gt;/*displayPhoneNumber*/&lt;/span&gt;);&lt;/pre&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/blockquote&gt;

&lt;p&gt;However, in general, I don't like to rely on conventions that force people to put comments in a certain style to make the code readable.&amp;#160; If possible, I'd rather design the API in such a way that it &lt;em&gt;has&lt;/em&gt; to be readable.&lt;/p&gt;

&lt;p&gt;The second option is using enum flags to represent the options.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;table cellspacing="0" cellpadding="10" width="400" border="1"&gt;&lt;tbody&gt;
      &lt;tr&gt;
        &lt;td valign="top" width="400"&gt;
          &lt;pre class="code"&gt;DisplayUser(user, &lt;span style="color: rgb(43,145,175)"&gt;Console&lt;/span&gt;.Out, &lt;span style="color: rgb(43,145,175)"&gt;DisplayUserOptions&lt;/span&gt;.Email);&lt;/pre&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/blockquote&gt;

&lt;p&gt;My problem with this approach is that it is hard to get right, both for the caller of the API, and the implementer.&amp;#160; This example is sort of trivial, but I can remember a time when I was dealing with a bit-field that contained 31 unique bit values that could be set and unset independently.&amp;#160; Getting all of the ~ and | and &amp;amp;'s just right was very hard, and once it was done, it was hard to figure out what it was trying to do.&amp;#160; A final reason that I don't like enums is that in practice I often find that there are more behaviors that I want to be able to add to the options which isn't possible with enums.&amp;#160; For example, it might be a requirement that two of the options are mutually exclusive.&amp;#160; It's difficult to ensure that this is enforced with an enum.&lt;/p&gt;

&lt;p&gt;Finally, we have the option of using a struct, which is addresses both of the two concerns above.&amp;#160; You can write a call like:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&amp;#160;&lt;/p&gt;

  &lt;table cellspacing="0" cellpadding="10" width="400" border="1"&gt;&lt;tbody&gt;
      &lt;tr&gt;
        &lt;td valign="top" width="400"&gt;
          &lt;pre class="code"&gt;&lt;span style="color: rgb(43,145,175)"&gt;DisplayUserOptions&lt;/span&gt; options = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;DisplayUserOptions&lt;/span&gt;();
options.Email = &lt;span style="color: rgb(0,0,255)"&gt;true&lt;/span&gt;;
options.PhoneNumber = &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt;;
DisplayUser(user, &lt;span style="color: rgb(43,145,175)"&gt;Console&lt;/span&gt;.Out, options);&lt;/pre&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/blockquote&gt;

&lt;p&gt;Well, that's certainly clear.&amp;#160; It also makes it easier to understand control flow that sets or clears the options, and to understand conditions based on them.&amp;#160; It also gives a place to add that behavior: I can add methods to the struct, make the fields into properties which have setters that do validation, etc.&lt;/p&gt;

&lt;p&gt;The problem with this approach is that in simple cases like the above, it is &lt;em&gt;much&lt;/em&gt; more verbose than either of the other two alternatives.&amp;#160; However, I recently realized that in C# 3.0, we can take advantage of Object Initializers to make the simple case simple again:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;table cellspacing="0" cellpadding="10" width="400" border="1"&gt;&lt;tbody&gt;
      &lt;tr&gt;
        &lt;td valign="top" width="400"&gt;
          &lt;pre class="code"&gt;DisplayUser(user, &lt;span style="color: rgb(43,145,175)"&gt;Console&lt;/span&gt;.Out, &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;DisplayUserOptions&lt;/span&gt; { Email = &lt;span style="color: rgb(0,0,255)"&gt;true&lt;/span&gt;, PhoneNumber = &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt; });&lt;/pre&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's almost like having named parameters in C# :)&lt;/p&gt;

&lt;p&gt;What do you think?&amp;#160; Which alternative do you prefer?&amp;#160; Do you have another one that I haven't thought of?&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6618087" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry><entry><title>Dogfooding Challenges Part Two: Unit Testing.</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2007/11/29/dodfooding-challenges-part-two-unit-testing.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2007/11/29/dodfooding-challenges-part-two-unit-testing.aspx</id><published>2007-11-29T19:38:00Z</published><updated>2007-11-29T19:38:00Z</updated><content type="html">&lt;P&gt;Another problem related to using VS in order to develop VS happens in the area of unit testing.&amp;nbsp; The problem here is that my team would like to write tests for the C# language service in C#, unfortunately, this means that our dogfood IDE has the release version of the language service already loaded.&amp;nbsp; Due to the way DLL loading works in windows, you can only have a DLL loaded with a given name, which means that the Unit Test framework is unable to load the debug copy of the language service that we just built.&amp;nbsp; On our team, we work around that by building two versions of all of our assemblies, which are identical except for their names.&amp;nbsp; That way we're able to load a unit-test specific version.&lt;/P&gt;
&lt;P&gt;Unfortunately, this has other drawbacks.&amp;nbsp; For example, it makes it impossible to combine code coverage results from unit tests, with the results from integration tests, since they are for different binaries. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6600358" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry><entry><title>Dodfooding Challenges Part One</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2007/11/24/dodfooding-challenges-part-one.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2007/11/24/dodfooding-challenges-part-one.aspx</id><published>2007-11-25T03:01:05Z</published><updated>2007-11-25T03:01:05Z</updated><content type="html">&lt;p&gt;There are a couple of issues that come up for developers who work on Visual Studio that just aren't issues for most people.&amp;#160; The first is that working on components of VS while using VS is hard.&amp;#160; It's hard for a couple of reasons.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;You want to have a debug build of the product to make it easier to debug, but at the same time, you want to have a release version of the product so that the performance isn't too bad.&lt;/li&gt;    &lt;li&gt;If you want to be able to replace a component in the editor, you need to shut-down the editor, replace the component, then restart the editor, since windows holds the file locked.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Before we started working on VS2008 we had a single solution for both of these problems: Side by Side installs of Visual Studio.&amp;#160; Back in the day, most developers who worked on Visual Studio didn't actually install Visual Studio through the setup process.&amp;#160; &lt;/p&gt;  &lt;h2&gt;Batch Setup&lt;/h2&gt;  &lt;p&gt;Instead we had a batch script which would copy the binaries from the daily build machine and then run regsvr32 on a huge list of different dlls in order to getting a &amp;quot;working&amp;quot; version of VS.&amp;#160; This had some advantages, but also some very serious drawbacks.&lt;/p&gt;  &lt;h3&gt;Pros:&lt;/h3&gt;  &lt;ol&gt;   &lt;li&gt;Batch Setup allowed us to have two sets of binaries in two different locations.&amp;#160; One of these was the &amp;quot;dogfood&amp;quot; or retail build, and the other was the &amp;quot;debug&amp;quot; build.&lt;/li&gt;    &lt;li&gt;Batch Setup allowed us to specify alternate registry roots for the two different builds.&amp;#160; This didn't work perfectly, as VS has some COM components that are registered in global locations, but it worked well enough that relatively few teams even had to care about what scenarios didn't work.&lt;/li&gt;    &lt;li&gt;Batch setup registered the binaries to their &amp;quot;built&amp;quot; locations.&amp;#160; The output tree of our build doesn't match where the binaries are installed by setup.&amp;#160; This means that if you have a real setup installed, and you build some binaries, you also have to copy them into place in order use them.&lt;/li&gt; &lt;/ol&gt;  &lt;h3&gt;Con:&lt;/h3&gt;  &lt;ol&gt;   &lt;li&gt;A minor con is the lack of &amp;quot;perfect&amp;quot; registry support for Side by Side.&lt;/li&gt;    &lt;li&gt;The major concern should be obvious: Dev's didn't run setup.&amp;#160; This meant that if a dev made a change to registration, or to the names or locations of files that need to be installed, they &lt;strong&gt;&lt;u&gt;usually&lt;/u&gt;&lt;/strong&gt; forgot to setup to do the right thing.&amp;#160; This meant that &lt;u&gt;&lt;strong&gt;most of the time, setup didn't actually work!&lt;/strong&gt;&lt;/u&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Because of the second drawback above, the division made a decision at the end of VS2005, that we wouldn't continue to use batch setup for VS2008.&amp;#160; Instead, we invested in updating our setup technology to make it easier for developers to build setup, and to understand how the setup gets built, so that it became easier to keep setup working.&amp;#160; We also invested in some tools to make using an installed build easier.&amp;#160; For example, we wrote a tools called &amp;quot;pupdate&amp;quot; that is able to update installed binaries from the location that they are built to automatically.&lt;/p&gt;  &lt;p&gt;However, we never did get to the point where it was possible to install two VS2008 builds side by side to enable the experience above.&amp;#160; How did dev's adapt to this?&amp;#160; There were 3 different ways:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Some people basically &lt;em&gt;stopped dogfooding&lt;/em&gt;.&amp;#160; That is, they continued to use VS2005 as their dogfood build, since it was possible to install VS2005 side by side with VS2008.&lt;/li&gt;    &lt;li&gt;Some people started doing &lt;em&gt;remote debugging.&lt;/em&gt;&amp;#160; Most of my team falls into this category.&amp;#160; In this solution, we took an old machine and installed the debug build on it, then we would use a dogfood build on our primary machine for doing work and building.&amp;#160; When we wanted to test some changes, we would &amp;quot;pupdate&amp;quot; the binaries from the primary machine to the test machine, and then use remote debugging to debug.&lt;/li&gt;    &lt;li&gt;Some people created a stripped down installable version of VS that could be installed Side by Side and used that for their dogfood environment.&amp;#160; This is basically an express sku that was developed internally for developers to use.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;None of these are quite ideal, it'd be really nice to go back to the old days of being able to install 2 builds of VS side by side.&amp;#160; We're thinking about investing in that for VS10, but as far as I know, it's still up in the air.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6507266" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry><entry><title>VS Color schemes</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2007/11/22/vs-color-schemes.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2007/11/22/vs-color-schemes.aspx</id><published>2007-11-23T08:59:27Z</published><updated>2007-11-23T08:59:27Z</updated><content type="html">&lt;p&gt;A friend sent me a link to Tomas Restrepo's collection of &lt;a href="http://www.winterdom.com/weblog/CategoryView,category,VS%2BColor%2BScheme.aspx"&gt;VS Color Schemes&lt;/a&gt; today.&amp;#160; I think it's a fantastic idea.&amp;#160; I like to use a dark background, but there sure a lot of settings that need to be changed in order for it to be usable.&amp;#160; Especially if you use C++/C#/XML and XAML, which all have their own colors that need to be set...&lt;/p&gt;  &lt;p&gt;I'll definitely be giving some a try when I get back in the office on Wednesday.&amp;#160; So far I think &lt;a href="http://www.winterdom.com/weblog/2007/10/13/RagnarokAVS2005ColorScheme.aspx"&gt;Ragnarok Blue&lt;/a&gt; looks like it'll be my favorite.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6478507" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry><entry><title>Just call me Clark Griswold!</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/kevinpilchbisson/archive/2007/11/22/just-call-me-clark-griswold.aspx" /><id>http://blogs.msdn.com/kevinpilchbisson/archive/2007/11/22/just-call-me-clark-griswold.aspx</id><published>2007-11-23T08:53:51Z</published><updated>2007-11-23T08:53:51Z</updated><content type="html">&lt;p&gt;Today being Thanksgiving here in the US (it's a month late, I know, but what can you do, eh?), my family spent the day making a big turkey dinner.&amp;#160; My wife is usually the big cook in our house, but today she's got a bit of cold, so I ended up doing a bunch of the cooking, so that she could go and rest.&lt;/p&gt;  &lt;p&gt;We had just gotten dinner ready, got the kids settled down, and I was helping them get their plates ready.&amp;#160; I reached for the dish of stuffing, and it slipped out of my hand and shattered all over the table.&amp;#160; No stuffing for anyone, but lots of crying from the disappointed kids.&amp;#160; I think I'm going to have to make another batch of stuffing in the next few days...&lt;/p&gt;  &lt;p&gt;In the end, the rest of the dinner was acceptable, and we all enjoyed it, but I'm really starting to feel like I'm in &amp;quot;&lt;a href="http://en.wikipedia.org/wiki/National_Lampoon%27s_Christmas_Vacation"&gt;Christmas Vacation&lt;/a&gt;&amp;quot;&lt;/p&gt;  &lt;p&gt;On Sunday or Monday, I'll probably string some christmas lights, but I don't think they'll look anything like &lt;a href="http://blogs.msdn.com/ericgu/archive/2007/11/20/ring-of-fire.aspx"&gt;Eric's&lt;/a&gt;.&amp;#160; Hopefully I'll manage to get them to actually turn on though.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6478426" width="1" height="1"&gt;</content><author><name>kevinpilch-bisson</name><uri>http://blogs.msdn.com/members/kevinpilch-bisson.aspx</uri></author></entry></feed>