<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>Pilchie's C# and Visual Studio Blog</title><link>http://blogs.msdn.com/b/kevinpilchbisson/</link><description /><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Slides from my CodeMash Session</title><link>http://blogs.msdn.com/b/kevinpilchbisson/archive/2011/01/24/slides-from-my-codemash-session.aspx</link><pubDate>Mon, 24 Jan 2011 22:56:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10119638</guid><dc:creator>Pilchie (Kevin Pilch-Bisson)</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/kevinpilchbisson/rsscomments.aspx?WeblogPostID=10119638</wfw:commentRss><comments>http://blogs.msdn.com/b/kevinpilchbisson/archive/2011/01/24/slides-from-my-codemash-session.aspx#comments</comments><description>&lt;p&gt;Sorry for the delay.&amp;#160; I took a disconnected vacation for a week after &lt;a href="http://codemash.org" target="_blank"&gt;CodeMash&lt;/a&gt;.&amp;#160; Now that I’ve completed my own personal Planes, Trains and Automobiles trip, I wanted to make sure that I posted the slides from my &lt;a href="http://codemash.org/Sessions/Technology/.NET#Future+directions+for+C%23+and+Visual+Basic" target="_blank"&gt;CodeMash session&lt;/a&gt;.&amp;#160; You can get them &lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-31-22/7065.CodeMash_2D00_FutureOfCSharpAndVB.pptx" target="_blank"&gt;here&lt;/a&gt;. Remember, you can find the async demos that I did inside the &lt;a href="http://msdn.com/vstudio/async" target="_blank"&gt;Async CTP&lt;/a&gt; for Visual Studio 2010.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10119638" width="1" height="1"&gt;</description></item><item><title>Seattle CodeCamp 2010.</title><link>http://blogs.msdn.com/b/kevinpilchbisson/archive/2010/04/17/seattle-codecamp-2010.aspx</link><pubDate>Sun, 18 Apr 2010 02:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9997919</guid><dc:creator>Pilchie (Kevin Pilch-Bisson)</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/kevinpilchbisson/rsscomments.aspx?WeblogPostID=9997919</wfw:commentRss><comments>http://blogs.msdn.com/b/kevinpilchbisson/archive/2010/04/17/seattle-codecamp-2010.aspx#comments</comments><description>Well, it's been about a year since the last time I posted.&amp;#160; It's a little funny that my previous post was about how I'm going to speak at Seattle CodeCamp in 2008, and this post is about having just spoken at Seattle CodeCamp 2010.&amp;#160; Anyway, I've mostly been using Twitter to share what I've been working on.&amp;#160; I'm &lt;a href="http://twitter.com/Pilchie" target="_blank" mce_href="http://twitter.com/Pilchie"&gt;@Pilchie&lt;/a&gt; there.&amp;#160; Anyway, today I presented again on C# IDE Tips and Tricks for Visual Studio 2010.&amp;#160; Some people asked me if I could post the slides, so I've attached them to this post as a way to get them.&amp;#160; I also found out that all the sessions at CodeCamp were recorded, and are available online.&amp;#160; My talk is &lt;a href="http://events.boostweb20.com/Events/SeattleCodeCamp2010/#state=sessionCode%242007-5" target="_blank" mce_href="http://events.boostweb20.com/Events/SeattleCodeCamp2010/#state=sessionCode%242007-5"&gt;here.&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9997919" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-09-99-79-19/CodeCampTalk_2D00_2010.ppt" length="2437120" type="application/vnd.ms-powerpoint" /></item><item><title>I’m speaking at Seattle Code Camp this weekend.</title><link>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/11/13/i-m-speaking-at-seattle-code-camp-this-weekend.aspx</link><pubDate>Fri, 14 Nov 2008 05:08:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9068195</guid><dc:creator>Pilchie (Kevin Pilch-Bisson)</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/kevinpilchbisson/rsscomments.aspx?WeblogPostID=9068195</wfw:commentRss><comments>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/11/13/i-m-speaking-at-seattle-code-camp-this-weekend.aspx#comments</comments><description>&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;</description></item><item><title>Hotfix for VS2008 SP1 Available</title><link>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/10/30/hotfix-for-vs2008-sp1-available.aspx</link><pubDate>Fri, 31 Oct 2008 03:34:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9025610</guid><dc:creator>Pilchie (Kevin Pilch-Bisson)</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/kevinpilchbisson/rsscomments.aspx?WeblogPostID=9025610</wfw:commentRss><comments>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/10/30/hotfix-for-vs2008-sp1-available.aspx#comments</comments><description>&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;</description></item><item><title>CodeRush Xpress for C#</title><link>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/10/28/coderush-xpress-for-c.aspx</link><pubDate>Tue, 28 Oct 2008 21:13:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9020651</guid><dc:creator>Pilchie (Kevin Pilch-Bisson)</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/kevinpilchbisson/rsscomments.aspx?WeblogPostID=9020651</wfw:commentRss><comments>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/10/28/coderush-xpress-for-c.aspx#comments</comments><description>&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;</description></item><item><title>Removing elements from a Dictionary</title><link>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/10/27/removing-elements-from-a-dictionary.aspx</link><pubDate>Tue, 28 Oct 2008 03:42:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9019515</guid><dc:creator>Pilchie (Kevin Pilch-Bisson)</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/kevinpilchbisson/rsscomments.aspx?WeblogPostID=9019515</wfw:commentRss><comments>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/10/27/removing-elements-from-a-dictionary.aspx#comments</comments><description>&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;</description></item><item><title>ArgumentNullException and refactoring</title><link>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/10/27/argumentnullexception-and-refactoring.aspx</link><pubDate>Mon, 27 Oct 2008 17:58:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9018324</guid><dc:creator>Pilchie (Kevin Pilch-Bisson)</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/kevinpilchbisson/rsscomments.aspx?WeblogPostID=9018324</wfw:commentRss><comments>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/10/27/argumentnullexception-and-refactoring.aspx#comments</comments><description>&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;</description></item><item><title>Virtualization Update</title><link>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/10/27/virtualization-update.aspx</link><pubDate>Mon, 27 Oct 2008 17:38:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9018289</guid><dc:creator>Pilchie (Kevin Pilch-Bisson)</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/kevinpilchbisson/rsscomments.aspx?WeblogPostID=9018289</wfw:commentRss><comments>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/10/27/virtualization-update.aspx#comments</comments><description>&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;</description></item><item><title>Getting on the virtualization bandwagon</title><link>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/08/15/getting-on-the-virtualization-bandwagon.aspx</link><pubDate>Fri, 15 Aug 2008 17:55:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8869818</guid><dc:creator>Pilchie (Kevin Pilch-Bisson)</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/kevinpilchbisson/rsscomments.aspx?WeblogPostID=8869818</wfw:commentRss><comments>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/08/15/getting-on-the-virtualization-bandwagon.aspx#comments</comments><description>&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;</description></item><item><title>Where has Kevin been?</title><link>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/02/14/where-has-kevin-been.aspx</link><pubDate>Fri, 15 Feb 2008 01:55:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7702397</guid><dc:creator>Pilchie (Kevin Pilch-Bisson)</dc:creator><slash:comments>38</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/kevinpilchbisson/rsscomments.aspx?WeblogPostID=7702397</wfw:commentRss><comments>http://blogs.msdn.com/b/kevinpilchbisson/archive/2008/02/14/where-has-kevin-been.aspx#comments</comments><description>&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;</description></item></channel></rss>