<?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>@ Head : VS2008</title><link>http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx</link><description>Tags: VS2008</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Saving and transferring customisations</title><link>http://msmvps.com/blogs/bill/archive/2009/11/25/saving-and-transferring-customisations.aspx</link><pubDate>Wed, 25 Nov 2009 03:54:10 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1742064</guid><dc:creator>bill</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1742064</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2009/11/25/saving-and-transferring-customisations.aspx#comments</comments><description>&lt;p&gt;I got an email from a reader last week asking about saving customisations in Visual Studio:&lt;/p&gt;  &lt;blockquote style="color:#7f7f7f;"&gt;   &lt;p&gt;Hi Bill&lt;/p&gt;    &lt;p&gt;I read an excellent article by you&lt;/p&gt;    &lt;p&gt;&lt;a href="http://visualstudiomagazine.com/Articles/2007/12/01/Customize-the-VB-IDE.aspx?Page=1"&gt;http://visualstudiomagazine.com/Articles/2007/12/01/Customize-the-VB-IDE.aspx?Page=1&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Just wondering if you know of a way to export those customisations so I can set up my computer at work restore after HDD fails and share my favorite settings with friends.&lt;/p&gt;    &lt;p&gt;Also would like to do same for my VBIDE customisations&lt;/p&gt;    &lt;p&gt;I have googled to no avail...... :-/ &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Well the good news is this is incredibly easy. On the Tools menu in Visual Studio you should see the “&lt;strong&gt;Import and Export Savings . . &lt;/strong&gt;.” command.&amp;#160; You can choose what groups of settings to import or export.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1742064" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VSM/default.aspx">VSM</category><category domain="http://msmvps.com/blogs/bill/archive/tags/DevCenter/default.aspx">DevCenter</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/CSharp/default.aspx">CSharp</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Updates on the Snippet Editor</title><link>http://msmvps.com/blogs/bill/archive/2009/09/03/updates-on-the-snippet-editor.aspx</link><pubDate>Thu, 03 Sep 2009 01:03:56 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1720398</guid><dc:creator>bill</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1720398</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2009/09/03/updates-on-the-snippet-editor.aspx#comments</comments><description>&lt;p&gt;First the good news :&lt;/p&gt;  &lt;p&gt;The February release of the &lt;a href="http://billmccarthy.com/Projects/Snippet_Editor/default.html"&gt;Snippet Editor&lt;/a&gt; has now had &lt;strong&gt;10,000&lt;/strong&gt; downloads !&lt;/p&gt;  &lt;p&gt;Now for bug fix news:&lt;/p&gt;  &lt;p&gt;There were a couple of issues with the paths per language.&amp;#160; A problem with Express Editions of Visual Studio occurred due to partial entries in the registry I didn’t for-see. Initial design and testing was done with full versions of Visual Studio, but I want to ensure that it does work with the express versions, that’s why the tool is standalone not an add-in.&amp;#160; So the good news is I have fixed those bugs (I think).&amp;#160; &lt;/p&gt;  &lt;p&gt;If you want those fixes you can use the original source from Feb and just &lt;a href="http://snippeteditor.codeplex.com/SourceControl/changeset/view/36425#391917"&gt;download the updated products.vb&lt;/a&gt; file. I’ll probably look at rolling this up into a new release in the not to distant future.&lt;/p&gt;  &lt;p&gt;Enjoy :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1720398" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Whidbey/default.aspx">Whidbey</category><category domain="http://msmvps.com/blogs/bill/archive/tags/DevCenter/default.aspx">DevCenter</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Snippets/default.aspx">Snippets</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/CSharp/default.aspx">CSharp</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS+10/default.aspx">VS 10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/XML/default.aspx">XML</category></item><item><title>String.IsNullOrEmpty : update on that nasty null reference exception</title><link>http://msmvps.com/blogs/bill/archive/2009/03/10/string-isnullorempty-update-on-that-nasty-null-reference-exception.aspx</link><pubDate>Tue, 10 Mar 2009 12:08:26 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1677289</guid><dc:creator>bill</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1677289</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2009/03/10/string-isnullorempty-update-on-that-nasty-null-reference-exception.aspx#comments</comments><description>&lt;p&gt;Back in April 2006, &lt;a href="http://msmvps.com/blogs/bill/archive/2006/04/04/89234.aspx" target="_blank"&gt;I blogged about a nasty JIT compiler optimisation&lt;/a&gt; that would cause String.IsNullOrEmpty to throw a null reference exception;&amp;#160; ironic really given that is the very thing you’d use the IsNullOrEmpty method to check against.&amp;#160; Well since then, due to popular demand on the connect site, this bug has been fixed in .NET 2.0 SP1 (which implies .NET 3.0 and 3.5)&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://msmvps.com/kb/940900/"&gt;&lt;em&gt;940900&lt;/em&gt;&lt;/a&gt;&lt;em&gt; (http://support.microsoft.com/kb/940900/ ) FIX: You receive the NullReferenceException exception when you call the String.IsNullOrEmpty function in an application that is built on the .NET Framework 2.0&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1677289" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Whidbey/default.aspx">Whidbey</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VB10/default.aspx">VB10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Bug/default.aspx">Bug</category><category domain="http://msmvps.com/blogs/bill/archive/tags/CSharp/default.aspx">CSharp</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category></item><item><title>When ….</title><link>http://msmvps.com/blogs/bill/archive/2009/02/21/when.aspx</link><pubDate>Sat, 21 Feb 2009 01:56:52 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1673043</guid><dc:creator>bill</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1673043</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2009/02/21/when.aspx#comments</comments><description>&lt;p&gt;VB has a lot of high level features other .Net languages, in particular C# don’t.&amp;#160; Sadly these are often overlooked by some developers because other languages like C# don’t have them – the lowest common denominator syndrome.&amp;#160; This is sad because many of these features are actually part of the .NET runtime.&amp;#160; For example, VB has full interface mapping, C# has only a limited form of interface mapping they call explicit interface implementation which for them relies on a&amp;#160; constrained naming pattern.&amp;#160; Another example is custom events in VB, where VB provides the full encapsulation the CIL provides: being the Add, Remove and Raise for the event. (C# doesn’t support the Raise or Fire).&amp;#160; The most obvious example would have to be Optional parameters. For years the C# brethren dismissed them as evil and in C# 4.0 now tout them as their amazing new feature they’ve added ;)&lt;/p&gt;  &lt;p&gt;Another rarely spoken of feature that VB and the .NET runtime support are exception filters … the When clause.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;Read why you should use When in the CLR team’s blog:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/clrteam/archive/2009/02/05/catch-rethrow-and-filters-why-you-should-care.aspx" href="http://blogs.msdn.com/clrteam/archive/2009/02/05/catch-rethrow-and-filters-why-you-should-care.aspx"&gt;http://blogs.msdn.com/clrteam/archive/2009/02/05/catch-rethrow-and-filters-why-you-should-care.aspx&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1673043" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/CSharp/default.aspx">CSharp</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Snippet Editor 2.1 screen-cast</title><link>http://msmvps.com/blogs/bill/archive/2009/02/05/snippet-editor-2-1-screen-cast.aspx</link><pubDate>Thu, 05 Feb 2009 09:08:31 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1669250</guid><dc:creator>bill</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1669250</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2009/02/05/snippet-editor-2-1-screen-cast.aspx#comments</comments><description>&lt;p&gt;I’ve just uploaded a new screen cast:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://billmccarthy.com/Projects/Snippet_Editor/screencast.html" target="_blank"&gt;Snippet Editor Tips and Tricks&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Enjoy :)&lt;/p&gt;  &lt;p&gt;(oh and don’t forget the “&lt;a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;amp;hosted_button_id=2895732" target="_blank"&gt;buy me a beer&lt;/a&gt;” button)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1669250" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Whidbey/default.aspx">Whidbey</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VB10/default.aspx">VB10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Snippets/default.aspx">Snippets</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/CSharp/default.aspx">CSharp</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS+10/default.aspx">VS 10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/XML/default.aspx">XML</category></item><item><title>New release of Snippet Editor</title><link>http://msmvps.com/blogs/bill/archive/2009/02/04/new-release-of-snippet-editor.aspx</link><pubDate>Tue, 03 Feb 2009 17:31:38 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1668548</guid><dc:creator>bill</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1668548</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2009/02/04/new-release-of-snippet-editor.aspx#comments</comments><description>&lt;p&gt;Snippet Editor 2.1 is now released on codeplex:    &lt;br /&gt;&lt;a title="http://www.codeplex.com/SnippetEditor" href="http://www.codeplex.com/SnippetEditor"&gt;http://www.codeplex.com/SnippetEditor&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Apart from the few minor bug fixes, it includes improved search and now support for Visual Studio 2010 as well as 2008 and 2005.&lt;/p&gt;  &lt;p&gt;I’ve also added a “buy me a beer” button to this blog, and on the codeplex site, so if you like the Snippet Editor you can help put a smile on my face :) &lt;/p&gt;  &lt;p&gt;&lt;a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;amp;hosted_button_id=2895732"&gt;&lt;img title="donate" alt="donate" src="http://msmvps.com/cfs-filesystemfile.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bill/bymeabeer.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The snippet editor remains free: no advertisements, no nag screens.&amp;#160; &lt;/p&gt;  &lt;p&gt;yep, free as in beer ;)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Enjoy :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1668548" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Whidbey/default.aspx">Whidbey</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VB10/default.aspx">VB10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Snippets/default.aspx">Snippets</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/CSharp/default.aspx">CSharp</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS+10/default.aspx">VS 10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/XML/default.aspx">XML</category></item><item><title>Iterators in VB 10 ?</title><link>http://msmvps.com/blogs/bill/archive/2009/02/02/iterators-in-vb-10.aspx</link><pubDate>Mon, 02 Feb 2009 13:56:01 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1668151</guid><dc:creator>bill</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1668151</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2009/02/02/iterators-in-vb-10.aspx#comments</comments><description>&lt;p&gt;Although VB 10 won’t have a formal syntax for iterators, it will have all the necessary ingredients to easily write iterators. In VB10 you can use a generic template and multi line lambdas to create iterators. &lt;/p&gt;  &lt;p&gt;This iterator in C# :&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt; static public IEnumerable&amp;lt;String&amp;gt; Lines( this TextReader rdr)      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; String line;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; while ((line = rdr.ReadLine()) != null)&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; yield return line;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Can be written as this in VB10:&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre&gt;&lt;font face="Trebuchet MS"&gt;&amp;lt;Extension()&amp;gt; &lt;/font&gt;&lt;br /&gt;Public Function Lines(ByVal rdr as TextReader) As IEnumerable(Of String)&lt;/pre&gt;

  &lt;pre&gt;     Return New GenericIterator(Of String) 
          (&lt;strong&gt;Function(ByRef nextItem As String) As Boolean
              nextItem = rdr.ReadLine
              Return nextItem IsNot Nothing
           End Function)&lt;/strong&gt;&lt;/pre&gt;

  &lt;pre&gt;End Function&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The above code uses a generic iterator class that accepts a lambda function. The lambda function sets the Current item of the iterator and returns True if MoveNext should be True. The above example is written as an extension method, but you can also use the inner part of the function inline.&lt;/p&gt;

&lt;p&gt;For more on using iterators in VB 9 today, as well as the generic class for the above example, see &lt;a href="http://visualstudiomagazine.com/columns/article.aspx?editorialsid=2972" target="_blank"&gt;my latest article in Visual Studio Magazine .&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1668151" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VSM/default.aspx">VSM</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VB10/default.aspx">VB10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/CSharp/default.aspx">CSharp</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS+10/default.aspx">VS 10</category></item><item><title>VB.Net and splash screens</title><link>http://msmvps.com/blogs/bill/archive/2009/01/20/vb-net-and-splash-screens.aspx</link><pubDate>Tue, 20 Jan 2009 00:27:39 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1663420</guid><dc:creator>bill</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1663420</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2009/01/20/vb-net-and-splash-screens.aspx#comments</comments><description>&lt;p&gt;One of the nice things about the My application framework in VB.NET is the ability to easily show splash screens.&amp;#160; The splash screen is displayed using a separate thread and by default will close when your main form’s Load event is called. There is however a quirk with it &lt;em&gt;sometimes&lt;/em&gt;. &lt;/p&gt;  &lt;p&gt;Whilst testing, if I launched the application from Explorer, the splash screen would appear in front of the explorer window but the main form behind it.&amp;#160; When the splash screen closed, the main form didn’t come to the foreground.&amp;#160; This behaviour would depend on the system being tested and seems to only consistently show up when run from a VPC.&amp;#160; The fix for this is reasonably simple: you just need to call Activate in your main form’s Load event&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="font-size:11pt;background:#f1f3f2;color:black;font-family:consolas;"&gt;   &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Private&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; Me_Load(&lt;span style="color:#3092b1;"&gt;ByVal&lt;/span&gt; sender &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; Object, &lt;span style="color:#3092b1;"&gt;ByVal&lt;/span&gt; e &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; EventArgs) &lt;span style="color:#3092b1;"&gt;Handles&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;MyBase&lt;/span&gt;.Load&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Me&lt;/span&gt;.Activate()&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Kudos to &lt;a href="http://blogs.msdn.com/vbteam/" target="_blank"&gt;the VB team&lt;/a&gt; for the fix :)&lt;/p&gt;  &lt;p&gt;When the VB team suggested this fix to me, I could have sworn I had already tried that.&amp;#160; I had also looked into the my application framework code and saw it called Activate in it’s handler of the Load. So my first thoughts on it was it was a race condition, and hence I set up a single shot timer to call Activate, the timer being set to trigger a couple of hundred milliseconds after the load event.&amp;#160; At first I thought that fixed it, but that was the “sometimes” effect tricking me &amp;lt;g&amp;gt;&lt;/p&gt;  &lt;p&gt;Kevin from the VB team suggested I try Activate in the Load event, and sure enough it seems to work *&lt;strong&gt;ALL&lt;/strong&gt;* the time.&amp;#160; But this was even more puzzling as to why didn’t my timer approach work.&amp;#160; So I tried overriding the OnLoad method :&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="font-size:11pt;background:#f1f3f2;color:black;font-family:consolas;"&gt;   &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Protected&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Overrides&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; OnLoad(&lt;span style="color:#3092b1;"&gt;ByVal&lt;/span&gt; e &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; EventArgs)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;MyBase&lt;/span&gt;.OnLoad(e)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Me&lt;/span&gt;.Activate()&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;That actually fails ( yes “sometimes”).&amp;#160; But if you change that to:&lt;/p&gt;  &lt;div style="font-size:11pt;background:#f1f3f2;color:black;font-family:consolas;"&gt;   &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160; &lt;span style="color:#3092b1;"&gt;Protected&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Overrides&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; OnLoad(&lt;span style="color:#3092b1;"&gt;ByVal&lt;/span&gt; e &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; EventArgs)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Me&lt;/span&gt;.Activate()&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;MyBase&lt;/span&gt;.OnLoad(e)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Then it works. So the key is that Activate has to be called before the call to OnLoad completes.&amp;#160;&amp;#160; Suddenly the pieces of the puzzle all fit together.&amp;#160; &lt;/p&gt;  &lt;p&gt;What I think is happening is this: The my application framework hooks into the Load event and uses that to dispose of the splash screen. The problem occurs when the splash screen which has the UI input is closed before the call to Activate is made. Because the calling thread doesn’t have the UI Input, SetForeGround window doesn’t work.&amp;#160; Based on this hypothesis, I suggested a fix to the WindowsFormsApplicationBase.&amp;#160; Currently is has this method in it:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="font-size:11pt;background:#f1f3f2;color:black;font-family:consolas;"&gt;   &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background:#e6ffe6;color:green;"&gt;&amp;#39;&amp;#39;&amp;#39;************************************************************************** &lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background:#e6ffe6;color:green;"&gt;&amp;#39;&amp;#39;&amp;#39; ;HideSplashScreen&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background:#e6ffe6;color:green;"&gt;&amp;#39;&amp;#39;&amp;#39; &amp;lt;summary&amp;gt; &lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background:#e6ffe6;color:green;"&gt;&amp;#39;&amp;#39;&amp;#39; Hide the splash screeen.&amp;#160; The splash screen was created on another thread so marshal &lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background:#e6ffe6;color:green;"&gt;&amp;#39;&amp;#39;&amp;#39; the call over to it.&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background:#e6ffe6;color:green;"&gt;&amp;#39;&amp;#39;&amp;#39; &amp;lt;/summary&amp;gt; &lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background:#e6ffe6;color:green;"&gt;&amp;#39;&amp;#39;&amp;#39; &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;EditorBrowsable(EditorBrowsableState.Advanced)&amp;gt; &lt;span style="color:#3092b1;"&gt;Protected&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; HideSplashScreen()&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;SyncLock&lt;/span&gt; m_SplashLock &lt;span style="background:#e6ffe6;color:green;"&gt;&amp;#39;We can get called from two threads at once&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&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; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt; m_SplashScreen &lt;span style="color:#3092b1;"&gt;IsNot&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;AndAlso&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Not&lt;/span&gt; m_SplashScreen.IsDisposed &lt;span style="color:#3092b1;"&gt;Then&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin:0px;"&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; &lt;span style="color:#3092b1;"&gt;Dim&lt;/span&gt; TheBigGoodbye &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;New&lt;/span&gt; DisposeDelegate(&lt;span style="color:#3092b1;"&gt;AddressOf&lt;/span&gt; m_SplashScreen.Dispose)&lt;/p&gt;    &lt;p style="margin:0px;"&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; m_SplashScreen.Invoke(TheBigGoodbye) &lt;/p&gt;    &lt;p style="margin:0px;"&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; m_SplashScreen = &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin:0px;"&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; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&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; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Me&lt;/span&gt;.MainForm &lt;span style="color:#3092b1;"&gt;IsNot&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Then&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin:0px;"&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; &lt;span style="color:#3092b1;"&gt;Call&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;New&lt;/span&gt; System.Security.Permissions.UIPermission(UIPermissionWindow.AllWindows).Assert()&lt;/p&gt;    &lt;p style="margin:0px;"&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; &lt;span style="color:#3092b1;"&gt;Me&lt;/span&gt;.MainForm.Activate()&lt;/p&gt;    &lt;p style="margin:0px;"&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; System.Security.PermissionSet.RevertAssert() &lt;span style="background:#e6ffe6;color:green;"&gt;&amp;#39;CLR also reverts if we throw or when we return from this function&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&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; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;SyncLock&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; &lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;My suggestion is to activate the main form before disposing of the splash screen :&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="font-size:11pt;background:#f1f3f2;color:black;font-family:consolas;"&gt;   &lt;p style="margin:0px;"&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="background:#e6ffe6;color:green;"&gt;&lt;/span&gt;&lt;/p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;EditorBrowsable(EditorBrowsableState.Advanced)&amp;gt; &lt;span style="color:#3092b1;"&gt;Protected&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; HideSplashScreen()    &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;span style="color:#3092b1;"&gt;SyncLock&lt;/span&gt; m_SplashLock &lt;span style="background:#e6ffe6;color:green;"&gt;&amp;#39;We can get called from two threads at once&lt;/span&gt;    &lt;p style="margin:0px;"&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:#3092b1;"&gt;&lt;/span&gt;&lt;/p&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; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Me&lt;/span&gt;.MainForm &lt;span style="color:#3092b1;"&gt;IsNot&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Then     &lt;br /&gt;&lt;/span&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; &lt;span style="color:#3092b1;"&gt;Call&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;New&lt;/span&gt; System.Security.Permissions.UIPermission(UIPermissionWindow.AllWindows).Assert()    &lt;p style="margin:0px;"&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; &lt;span style="color:#3092b1;"&gt;Me&lt;/span&gt;.MainForm.Activate()&lt;/p&gt;    &lt;p style="margin:0px;"&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; System.Security.PermissionSet.RevertAssert() &lt;span style="background:#e6ffe6;color:green;"&gt;&amp;#39;CLR also reverts if we throw or when we return from this function&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&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; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&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; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt; m_SplashScreen &lt;span style="color:#3092b1;"&gt;IsNot&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;AndAlso&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Not&lt;/span&gt; m_SplashScreen.IsDisposed &lt;span style="color:#3092b1;"&gt;Then&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin:0px;"&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; &lt;span style="color:#3092b1;"&gt;Dim&lt;/span&gt; TheBigGoodbye &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;New&lt;/span&gt; DisposeDelegate(&lt;span style="color:#3092b1;"&gt;AddressOf&lt;/span&gt; m_SplashScreen.Dispose)&lt;/p&gt;    &lt;p style="margin:0px;"&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; m_SplashScreen.Invoke(TheBigGoodbye) &lt;/p&gt;    &lt;p style="margin:0px;"&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; m_SplashScreen = &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt; &lt;/p&gt;    &lt;p style="margin:0px;"&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; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;SyncLock&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; &lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Hopefully that will fix this issue completely. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;In the meanwhile, simply call Activate in your main form’s Load event :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1663420" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VB10/default.aspx">VB10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Bug/default.aspx">Bug</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS+10/default.aspx">VS 10</category></item><item><title>Extension methods and Interfaces.</title><link>http://msmvps.com/blogs/bill/archive/2009/01/15/extension-methods-and-interfaces.aspx</link><pubDate>Thu, 15 Jan 2009 04:58:59 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1661885</guid><dc:creator>bill</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1661885</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2009/01/15/extension-methods-and-interfaces.aspx#comments</comments><description>&lt;p&gt;A comment by &lt;a href="http://blogs.msdn.com/brada/archive/2009/01/12/framework-design-guidelines-extension-methods.aspx" target="_blank"&gt;Joe Duffy on the Framework Guidelines for Extension&lt;/a&gt; says :&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Extension methods can also be used to provide actual concrete method implementations for interfaces.&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And this is a very important point. In .NET there is no support for multiple implementation inheritance. So although you could use an abstract class (MustInherit) with some implementation in it, you would be tied to that single chain in your class inheritance. Interfaces on the other hand are extremely flexible, supporting multiple inheritance both in interfaces and implementing classes.&amp;#160; So by providing extension methods for interfaces, you get great flexibility and code re-use, and you also get to extend existing interfaces.. the classic example being the Enumerable set of extensions which extend IEnumerable(Of T)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1661885" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VB10/default.aspx">VB10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category></item><item><title>So what is a “Library”  ?</title><link>http://msmvps.com/blogs/bill/archive/2009/01/12/so-what-is-a-library.aspx</link><pubDate>Sun, 11 Jan 2009 14:13:41 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1660746</guid><dc:creator>bill</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1660746</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2009/01/12/so-what-is-a-library.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/blogs/bill/archive/2009/01/11/winfs-it-s-b-a-a-a-ck.aspx" target="_blank"&gt;Earlier I posted&lt;/a&gt; what I hope wetted your appetite for some more info about Libraries in Windows 7.&amp;#160; So&amp;#160; what are libraries you ask//I ask ;) Well I hope the following provides some insight.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;em&gt;caveat emptor: this is still just my first impressions !&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;A Library is really a view of different “folders”.&amp;#160; Each library is a file, which internally is an xml file.&amp;#160; The default library files are stored in the user’s roaming profile, eg:&lt;/p&gt;  &lt;p&gt;C:\Users\Bill\AppData\Roaming\Microsoft\Windows\Libraries&lt;/p&gt;  &lt;p&gt;This is an example of &lt;/p&gt;  &lt;div style="font-size:11pt;background:#f1f3f2;color:black;font-family:consolas;"&gt;   &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color:#a31515;"&gt;xml&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:#a60000;"&gt;version&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&lt;span style="color:#2d7bd2;"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:#a60000;"&gt;encoding&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&lt;span style="color:#2d7bd2;"&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;?&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;libraryDescription&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ownerSID&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;S-1-5-21-168223323-3520011370-4180941423-1000&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ownerSID&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;version&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;3&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;version&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;isLibraryPinned&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;-1&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;isLibraryPinned&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;templateInfo&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;folderType&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;{5C4F28B5-F869-4E84-8E60-F11DB97C5CC7}&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;folderType&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;templateInfo&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;propertyStore&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:#a60000;"&gt;name&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&lt;span style="color:#2d7bd2;"&gt;&amp;quot;HasModifiedLocations&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;span style="color:#a60000;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&lt;span style="color:#2d7bd2;"&gt;&amp;quot;boolean&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&amp;lt;![CDATA[&lt;/span&gt;&lt;span style="color:gray;"&gt;-1&lt;/span&gt;&lt;span style="color:blue;"&gt;]]&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;property&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;propertyStore&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;searchConnectorDescriptionList&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;searchConnectorDescription&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;isDefaultSaveLocation&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;-1&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;isDefaultSaveLocation&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;simpleLocation&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;url&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;C:\Users\Bill\Documents\Visual Studio 2008\Projects&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;url&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;serialized&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;serialized&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;simpleLocation&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;searchConnectorDescription&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;searchConnectorDescriptionList&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;libraryDescription&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I omitted the contents of the serialized element for brevity.&lt;/p&gt;  &lt;p&gt;You can programmatically access libraries via the IShellLibrary interface and some shell helper functions.&amp;#160; &lt;/p&gt;  &lt;p&gt;You can add multiple “folders” to these library files.&amp;#160; I say “folders” in quotes, because according to the IShellLibrary::AddFolder documentation, &lt;strong&gt;&lt;em&gt;the object in psiLocation can be a folder or a Search Connector (*.searchconnector-ms) file&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;What’s this mean.&amp;#160; Well I don’t know for sure yet, but it looks to me like Libraries can be a way to aggregate search providers. At the simplest level they provide a view of directories, but they have the potential to provide a view over data from various sources, not just file based.&amp;#160; This of course leads us towards the topic of “Federated Search” (more on that in next episode &amp;lt;g&amp;gt;).&amp;#160; &lt;/p&gt;  &lt;p&gt;So is it WinFS ? Not really. It is not reliant on managed frameworks like the entity framework… it is instead heavily reliant on XML. From the Library file, saved searches, right through to Federated Search which itself is based around RSS style of XML.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;Thankfully VB9 rocks when it comes to working with XML !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1660746" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VB10/default.aspx">VB10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/XML/default.aspx">XML</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Windows+7/default.aspx">Windows 7</category></item><item><title>Xelement : more Value in that Value !!</title><link>http://msmvps.com/blogs/bill/archive/2009/01/05/xelement-more-value-in-that-value.aspx</link><pubDate>Mon, 05 Jan 2009 00:56:32 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1658488</guid><dc:creator>bill</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1658488</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2009/01/05/xelement-more-value-in-that-value.aspx#comments</comments><description>&lt;p&gt;XML is very flexible and somewhat permissive in what it allows. Consider this piece of XML:&lt;/p&gt;  &lt;div style="font-size:11pt;background:#f1f3f2;color:black;font-family:consolas;"&gt;   &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; el = &lt;span style="color:#d6788f;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c2844b;"&gt;item&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#9175bf;"&gt;&lt;strong&gt;some values&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c2844b;"&gt;first&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#9175bf;"&gt;one&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#c2844b;"&gt;first&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c2844b;"&gt;second&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#9175bf;"&gt;two&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#c2844b;"&gt;second&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#c2844b;"&gt;item&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The element named &lt;em&gt;&lt;strong&gt;item&lt;/strong&gt; &lt;/em&gt;can contain both child elements and a text value.&amp;#160; Thankfully this kind of XML is rare: it poses a heap of whitespace formatting issues, and the value itself can reside in any combination of places between the elements, eg:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="font-size:11pt;background:#f1f3f2;color:black;font-family:consolas;"&gt;   &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; el = &lt;span style="color:#d6788f;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c2844b;"&gt;item&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#9175bf;"&gt;&lt;strong&gt;some values&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c2844b;"&gt;first&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#9175bf;"&gt;one&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#c2844b;"&gt;first&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;gt;&lt;/span&gt;&lt;strong&gt; &lt;/strong&gt;&lt;span style="color:#9175bf;"&gt;&lt;strong&gt;are&lt;/strong&gt; &lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#c2844b;"&gt;second&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#9175bf;"&gt;two&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#c2844b;"&gt;second&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#9175bf;"&gt;&lt;strong&gt;in here&lt;/strong&gt;&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#c2844b;"&gt;item&lt;/span&gt;&lt;span style="color:#d6788f;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;How this is interpreted is questionable. You could argue that position needs to be preserved, in which case you’d work with the Nodes property, including both the nodes of type XElement and also XText. Each of the inline values, “some values”, “ are ” and “in here”&amp;#160; are actually XText nodes.&amp;#160; &lt;/p&gt;  &lt;p&gt;If you’re just after the Text, you need to write a helper function.&amp;#160; If you try to use the Value property you get the Value of all nested nodes.&amp;#160; Calling el.Value with the last example will output:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;some valuesone are twoin here&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The extension I slapped together is :&lt;/p&gt;  &lt;div style="font-size:11pt;background:#f1f3f2;color:black;font-family:consolas;"&gt;   &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &amp;lt;Extension()&amp;gt; _&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Public&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Function&lt;/span&gt; GetText(&lt;span style="color:#3092b1;"&gt;ByVal&lt;/span&gt; el &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; XElement) &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;String&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Not&lt;/span&gt; el.HasElements &lt;span style="color:#3092b1;"&gt;Then&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Return&lt;/span&gt; el.Value&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Dim&lt;/span&gt; sb &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;New&lt;/span&gt; StringBuilder&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;For&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Each&lt;/span&gt; nd &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; XNode &lt;span style="color:#3092b1;"&gt;In&lt;/span&gt; el.Nodes&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;TypeOf&lt;/span&gt; nd &lt;span style="color:#3092b1;"&gt;Is&lt;/span&gt; XText &lt;span style="color:#3092b1;"&gt;Then&lt;/span&gt; sb.Append(nd.ToString)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Next&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Return&lt;/span&gt; sb.ToString&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Function&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;With this the output is :&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;some values are in here&lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Enjoy :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1658488" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category><category domain="http://msmvps.com/blogs/bill/archive/tags/XML/default.aspx">XML</category></item><item><title>Registered Organization on 64 bit</title><link>http://msmvps.com/blogs/bill/archive/2009/01/03/registered-organization-on-64-bit.aspx</link><pubDate>Sat, 03 Jan 2009 02:15:54 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1658392</guid><dc:creator>bill</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1658392</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2009/01/03/registered-organization-on-64-bit.aspx#comments</comments><description>&lt;p&gt;When I’ve started new Visual Studio projects on my Vista x64 box, the Company field would always show up as “Microsoft”… somewhat presumptuous and definitely annoying.&amp;#160; At first I thought the problem was with the templates, but upon inspection they had the correct template parameters, $registeredorganization$.&amp;#160; A quick look in my registry and those keys looked right; then it dawned on me. Visual Studio runs as a 32 bit process, not 64, so it effectively looks in :&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;And that’s the solution. In there RegisteredOrganization was set to “Microsoft”.&amp;#160;&amp;#160; Changing that to your organization’s name solves the template issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1658392" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Whidbey/default.aspx">Whidbey</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Vista/default.aspx">Vista</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category></item><item><title>XSD’s in Visual Studio: Past, Present and Future.</title><link>http://msmvps.com/blogs/bill/archive/2008/12/30/xsd-s-in-visual-studio-past-present-and-future.aspx</link><pubDate>Tue, 30 Dec 2008 02:51:36 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1658055</guid><dc:creator>bill</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1658055</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2008/12/30/xsd-s-in-visual-studio-past-present-and-future.aspx#comments</comments><description>&amp;#160; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;When I was going through the &lt;a href="http://www.codeplex.com/SnippetEditor" target="_blank"&gt;snippet editor&lt;/a&gt; code to put it on CodePlex, I wanted to grab a screen shot of the snippet schema.&amp;#160; immediately I was confronted with there being no visual designer for schemas in VS 2008, but the worse part was I could have sworn there use to be.&amp;#160; To clear up that confusion here’s an illustrated history lesson on schema views in Visual Studio.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;In earlier versions of Visual Studio the schema designer was a bit like the early dataset designer. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;This is Visual Studio 2005 :&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bill/xsd2005_5F00_xFBMIA.png"&gt;&lt;img title="xsd2005" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="452" alt="xsd2005" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bill/xsd2005_5F00_thumb_5F00_hm6h7A.png" width="620" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;It was detailed as far as types and constraints goes but omitted documentation.&amp;#160; With complex schemas it was a mess, but you could hide parts.&lt;/p&gt;  &lt;p&gt;Then in Visual Studio 2008 they decided to get rid of the schema designer completely !!&amp;#160; I’m really not sure the logic on that. There was however a CTP for the new Schema Explorer, and come Visual Studio 2008 Service Pack 1, the schema explorer was included.&amp;#160; (I hope I’ve got that bit of history right)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bill/xsd2008_5F00_B1PwJQ.png"&gt;&lt;img title="xsd2008" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="356" alt="xsd2008" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bill/xsd2008_5F00_thumb_5F00_sG0GEQ.png" width="358" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The Schema explorer gives a nice overview, and provides for navigation but totally lacks real details (&lt;strong&gt;not&lt;/strong&gt; synchronized with the properties window).&amp;#160; Sadly for Visual Studio 2008 that’s as best as it gets, the rest is wading through the actual xsd file as xml.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The first CTP of Visual Studio 10, reveals a new designer that can be used in conjunction with the Schema Explorer.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bill/xsd2010_5F00_n4et6w.png"&gt;&lt;img title="xsd2010" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="476" alt="xsd2010" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bill/xsd2010_5F00_thumb_5F00_WZK35w.png" width="571" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;This pretty visual representation is all done in WPF so you can zoom in and out nicely. As well as the ability to easily expand and shrink elements, it’s really nice way to get an overview.&amp;#160; You can even turn on documentation so as you can see any comments from the schema:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bill/xsd2010_5F00_with_5F00_doc_5F00_FMtFMw.png"&gt;&lt;img title="xsd2010_with_doc" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="409" alt="xsd2010_with_doc" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/bill/xsd2010_5F00_with_5F00_doc_5F00_thumb_5F00_2wIj9w.png" width="592" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Although this is very pretty, and a great visual aid, it still doesn’t provide any means to create a schema or edit one… it’s simply a view.&amp;#160;&amp;#160; Some things I’d like to see improved are :&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Provide designer &lt;strong&gt;editing&lt;/strong&gt; and creation of schemas&amp;#160; &lt;/li&gt;    &lt;li&gt;have an export to .png feature &lt;/li&gt;    &lt;li&gt;Ability to fully expand comments for all items.&amp;#160; At present only the first two lines are shown and you have to double click on each element to get the comments to fully expand &lt;/li&gt;    &lt;li&gt;did I mention &lt;strong&gt;editing&lt;/strong&gt; ? &lt;/li&gt;    &lt;li&gt;tear-offs would be nice, such that I could then use the width of the screen (eg: Drag the “Header” element from the above picture to the right, and then it expands over there rather than in situ.) &lt;/li&gt;    &lt;li&gt;show restrictions. For example, the SnippetType is restricted to three possible legal values, “Expansion”, “SurroundsWith” and “Refactoring”.&amp;#160; To find that out I have to delve into the xsd. &lt;/li&gt;    &lt;li&gt;Synchronise with Properties window allowing for more detail to be shown and edited in the Properties window&lt;/li&gt;    &lt;li&gt;Provide Copy as Path. The bottom of the screen shows the path of the selected node, but it would be great if you could select to copy that to the clipboard as an XPath. Even cooler if you could choose between XPath, VB XML Axis/Literal sytnax, or XElement syntax (for those poor ol’ C# folks ;) )&lt;/li&gt;    &lt;li&gt;&amp;#160; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The Visual Studio 10 stuff looks promising, but still has a long way to go. (did I mention the lack of &lt;strong&gt;editing&lt;/strong&gt; ?)&amp;#160; In the interim it would be nice if there was &lt;strong&gt;&lt;em&gt;something&lt;/em&gt;&lt;/strong&gt;, &lt;em&gt;&lt;strong&gt;anything&lt;/strong&gt;&lt;/em&gt; !&amp;#160; I’m really not sure why the 2005 xsd designer was dropped. Sure some of it was ugly, especially the way it shows things like the string restrictions, but it was and is less ugly than the XML for&amp;#160; that part of the xsd !!&lt;/p&gt;  &lt;p&gt;Visually we have progressed... but what about the &lt;strong&gt;editing&lt;/strong&gt; ??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1658055" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Whidbey/default.aspx">Whidbey</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VB10/default.aspx">VB10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Snippets/default.aspx">Snippets</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS+10/default.aspx">VS 10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/XML/default.aspx">XML</category></item><item><title>Snippet Editor is now on CodePlex</title><link>http://msmvps.com/blogs/bill/archive/2008/12/28/snippet-editor-is-now-on-codeplex.aspx</link><pubDate>Sun, 28 Dec 2008 09:13:22 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1657880</guid><dc:creator>bill</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1657880</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2008/12/28/snippet-editor-is-now-on-codeplex.aspx#comments</comments><description>&lt;p&gt;I’ve just finished uploading the Snippet Editor to CodePlex&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.codeplex.com/SnippetEditor" href="http://www.codeplex.com/SnippetEditor"&gt;http://www.codeplex.com/SnippetEditor&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It includes some minor bug fixes from the previous release.&lt;/p&gt;  &lt;p&gt;Enjoy :)&lt;/p&gt;  &lt;p&gt;And Merry XMas :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1657880" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Whidbey/default.aspx">Whidbey</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VB10/default.aspx">VB10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Snippets/default.aspx">Snippets</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/CSharp/default.aspx">CSharp</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS+10/default.aspx">VS 10</category></item><item><title>List transactions</title><link>http://msmvps.com/blogs/bill/archive/2008/12/19/list-transactions.aspx</link><pubDate>Thu, 18 Dec 2008 14:55:53 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1657126</guid><dc:creator>bill</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1657126</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2008/12/19/list-transactions.aspx#comments</comments><description>&lt;p&gt;From a recent discussion on using lists, and whether or not you can remove items in while iterating, I decided to write an extension that allows you to get a “transaction” for an IList(Of t).&amp;#160; This ListTransaction(Of T) caches adds and removes until you call commit (kudos to Duncan for the idea !!).&amp;#160; It also implements IDisposable so you can use a using scope, eg:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="font-size:11pt;background:#f0f4f2;color:black;font-family:consolas;"&gt;   &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Using&lt;/span&gt; listTran = mylist.GetTransaction&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;For&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Each&lt;/span&gt; item &lt;span style="color:#3092b1;"&gt;In&lt;/span&gt; mylist&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="background:#e6ffe6;color:green;"&gt;&amp;#39; other code here&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; listTran.Remove(item)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Next&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Using&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And here’s the implementation:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="font-size:11pt;background:#f0f4f2;color:black;font-family:consolas;"&gt;   &lt;p style="margin:0px;"&gt;&lt;span style="color:#3092b1;"&gt;Module&lt;/span&gt; ListExtensions&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &amp;lt;Runtime.CompilerServices.Extension()&amp;gt; _&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Function&lt;/span&gt; GetTransaction(&lt;span style="color:#3092b1;"&gt;Of&lt;/span&gt; T)(&lt;span style="color:#3092b1;"&gt;ByVal&lt;/span&gt; list &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; IList(&lt;span style="color:#3092b1;"&gt;Of&lt;/span&gt; T)) &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; ListTransaction(&lt;span style="color:#3092b1;"&gt;Of&lt;/span&gt; T)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Return&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;New&lt;/span&gt; ListTransaction(&lt;span style="color:#3092b1;"&gt;Of&lt;/span&gt; T)(list)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Function&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Public&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Class&lt;/span&gt; ListTransaction(&lt;span style="color:#3092b1;"&gt;Of&lt;/span&gt; T)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Implements&lt;/span&gt; IDisposable&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Private&lt;/span&gt; _list &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; IList(&lt;span style="color:#3092b1;"&gt;Of&lt;/span&gt; T)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Private&lt;/span&gt; _adds &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; List(&lt;span style="color:#3092b1;"&gt;Of&lt;/span&gt; T)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Private&lt;/span&gt; _removes &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; List(&lt;span style="color:#3092b1;"&gt;Of&lt;/span&gt; T)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Public&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;New&lt;/span&gt;(&lt;span style="color:#3092b1;"&gt;ByVal&lt;/span&gt; list &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; IList(&lt;span style="color:#3092b1;"&gt;Of&lt;/span&gt; T))&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _list = list&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Public&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; Add(&lt;span style="color:#3092b1;"&gt;ByVal&lt;/span&gt; item &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; T)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt; _adds &lt;span style="color:#3092b1;"&gt;Is&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Then&lt;/span&gt; _adds = &lt;span style="color:#3092b1;"&gt;New&lt;/span&gt; List(&lt;span style="color:#3092b1;"&gt;Of&lt;/span&gt; T)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _adds.Add(item)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Public&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; Remove(&lt;span style="color:#3092b1;"&gt;ByVal&lt;/span&gt; item &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; T)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt; _removes &lt;span style="color:#3092b1;"&gt;Is&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Then&lt;/span&gt; _removes = &lt;span style="color:#3092b1;"&gt;New&lt;/span&gt; List(&lt;span style="color:#3092b1;"&gt;Of&lt;/span&gt; T)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _removes.Add(item)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Public&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; Commit()&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt; _list &lt;span style="color:#3092b1;"&gt;Is&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Then&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Exit&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt; _adds &lt;span style="color:#3092b1;"&gt;IsNot&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Then&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;For&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Each&lt;/span&gt; item &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; T &lt;span style="color:#3092b1;"&gt;In&lt;/span&gt; _adds&lt;/p&gt;    &lt;p style="margin:0px;"&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; _list.Add(item)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Next&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _adds = &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt; _removes &lt;span style="color:#3092b1;"&gt;IsNot&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Then&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;For&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Each&lt;/span&gt; item &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; T &lt;span style="color:#3092b1;"&gt;In&lt;/span&gt; _removes&lt;/p&gt;    &lt;p style="margin:0px;"&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; _list.Remove(item)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Next&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _removes = &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;If&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Public&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; Rollback()&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _adds = &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _removes = &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Public&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; Dispose() &lt;span style="color:#3092b1;"&gt;Implements&lt;/span&gt; IDisposable.Dispose&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Commit()&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; GC.SuppressFinalize(&lt;span style="color:#3092b1;"&gt;Me&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Class&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Module&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1657126" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VB10/default.aspx">VB10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS+10/default.aspx">VS 10</category></item><item><title>VB Snippet Editor</title><link>http://msmvps.com/blogs/bill/archive/2008/12/08/vb-snippet-editor.aspx</link><pubDate>Mon, 08 Dec 2008 11:42:02 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1656158</guid><dc:creator>bill</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1656158</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2008/12/08/vb-snippet-editor.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;Over the last week I’ve got a sudden influx of emails about the Snippet Editor.&amp;#160; I’m figuring this is stemming from &lt;a href="http://blogs.msdn.com/vbteam/archive/2008/12/07/did-you-know-there-are-many-ways-to-insert-a-snippet-into-your-code-lisa-feigenbaum.aspx" target="_blank"&gt;Lisa’s recent blog entry&lt;/a&gt; and her &lt;a href="http://blogs.msdn.com/vbteam/archive/2008/12/06/video-microsoft-visual-basic-2008-tips-and-tricks-lisa-feigenbaum.aspx" target="_blank"&gt;tips and trips for VS 2008 presentation&lt;/a&gt; :)&amp;#160; &lt;/p&gt;  &lt;p&gt;Some of the emails have been really nice praise, folks wanting to add some features, a bug on XP 64 (which unfortunately is about the only OS I don’t have in my testing suite), and some general questions around snippets.&amp;#160; So I gave this lots of thought and decided to put up a site on CodePlex. This will allow people to add features, work together on bugs, and share discussions around snippets including future directions for the snippet editor.&lt;/p&gt;  &lt;p&gt;The new codeplex site will be at &lt;a title="http://www.codeplex.com/SnippetEditor" href="http://www.codeplex.com/SnippetEditor"&gt;http://www.codeplex.com/SnippetEditor&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It’s not ready yet, and will probably be a week while I get all the bits together and ensure there’s no rude words in the code comments etc ;)&amp;#160; I was hesitant about moving to CodePlex as I was really disappointed how gotdotnet was just closed down and not migrated. And I should add here a word of caution for those in charge should CodePlex go a similar route.. I will travel the continents and track you down and when I find you stare at you for a really long time until you feel uncomfortable !!&amp;#160; ;)&amp;#160; (Seriously, please don’t close codeplex)&lt;/p&gt;  &lt;p&gt;So, all going well, the Snippet Editor will be on CodePlex this time next week.&amp;#160; I’ll make sure to post when it’s ready and redirect my current site there.&amp;#160; Any suggestions on the open&amp;#160; source license eula etc most welcome.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1656158" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Whidbey/default.aspx">Whidbey</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VB10/default.aspx">VB10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Snippets/default.aspx">Snippets</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/CSharp/default.aspx">CSharp</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS+10/default.aspx">VS 10</category></item><item><title>What we have here is a failure to communicate</title><link>http://msmvps.com/blogs/bill/archive/2008/11/14/what-we-have-here-is-a-failure-to-communicate.aspx</link><pubDate>Fri, 14 Nov 2008 02:33:49 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1654086</guid><dc:creator>bill</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1654086</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2008/11/14/what-we-have-here-is-a-failure-to-communicate.aspx#comments</comments><description>&lt;p&gt;you can tell from the title there’s a Friday rant coming can’t you ?&amp;#160; Well yeh, sometimes what should be a simple task of writing code becomes painstakingly slow.&amp;#160; Take for example this one line of code:&lt;/p&gt;  &lt;div style="font-size:11pt;background:white;color:black;font-family:consolas;"&gt;   &lt;p style="margin:0px;"&gt;&amp;#160; &lt;span style="color:#3092b1;"&gt;Dim&lt;/span&gt; doc = XDocument.Load(&lt;span style="background:#feffea;color:#a31515;"&gt;&amp;quot;abc.xml&amp;quot;&lt;/span&gt;)&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now if you like to write robust code, somewhere in your mind there should be that voice saying, “&lt;em&gt;ah but what if the file is not there or can’t be opened or isn’t valid xml&lt;/em&gt; “…etc, etc.&amp;#160; So the first thing you probably think of doing is look at what exceptions the method can throw,&amp;#160; or so you’d hope.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem 1&lt;/strong&gt;. VB doesn’t display the exception information from any xml documentation.&amp;#160; Our first failure to communicate that then leads us on a great chase.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem 2&lt;/strong&gt;. Who ever wrote the XDocument.Load method actually failed to provide the exception documentation. The Load method calls external methods such as XMLReader.Create and the exceptions from that are unchecked, allowed to bubble through. The documentation should indicate an include statement to say the XMLReader.Create exceptions bubble up.&amp;#160; The author(s) of XDocument.Load failed to communicate the exceptions that could be thrown.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem 3.&lt;/strong&gt; If you like to keep current and have installed the SilverLight 2.0 SDK, F1 help will take you to a SilverLight topic even if you are writing a Console application.&amp;#160; That little voice in your head that first said “&lt;em&gt;what if&lt;/em&gt; …” is now screaming.&amp;#160; There’s a failure to communicate between Visual Studio and MSDN help.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem 4.&lt;/strong&gt; Your only resolve is to do the lookup in msdn help yourself, only to find the documentation has no exception information because it relies on the xml documentation (see Problem 2).&amp;#160;&amp;#160; The failure to communicate cascades.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Problem 5.&lt;/strong&gt; As a last ditch desperate measure you use Reflector and walk through the code. Thankfully in this case the code is reasonably simple. The problem now is how do you get that information back into your code, so as you handle the correct exceptions ? This isn’t Relector’s fault as such, as the same problem exists if you do find the exception information in Visual Studio’s object browser. This is a failure to interact, but it can result in you not handling exceptions or documenting which exceptions bubble up from your methods, causing your code to fail to communicate. (see Problem 2.)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If religious wars were still in fashion, we’d be saying “hey what about checked exceptions al la Java ?”.&amp;#160; The more I am frustrated at how hard it is to write &lt;strong&gt;robust&lt;/strong&gt; code because of these often cascading failures to communicate, the more I want to sign up with the holly sect for checked exceptions.&lt;/p&gt;  &lt;p&gt;An alternative is to provide rich tooling and analysis.&amp;#160; Some years ago, myself and Geoff Appleby with some help from Mark Miller wrote a plug-in for refactor that did a look up based on the code you selected. It would match the method calls with their xml documentation, refine and sort the list based on inheritance rules (most specific first), and let you choose which ones to add to your code.&amp;#160; It really was simple once you got the method info, which is where refactor (or more accurately DXCore) came in. Unfortunately we hosted that project on the now defunct GotDotNet site :(&lt;/p&gt;  &lt;p&gt;Such a tool helps break the cycle here, but such a tool also needs to be used by Microsoft (see Problem 2 above), and there needs to be analysis to ensure exceptions are either handled or the documentation says what exceptions can be thrown. Writing robust code needs to be easier: we cannot just ignore exceptions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1654086" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Rant/default.aspx">Rant</category><category domain="http://msmvps.com/blogs/bill/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/CSharp/default.aspx">CSharp</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category></item><item><title>.NET 3.5 SP1 source code</title><link>http://msmvps.com/blogs/bill/archive/2008/09/12/net-3-5-sp1-source-code.aspx</link><pubDate>Thu, 11 Sep 2008 15:36:26 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1647492</guid><dc:creator>bill</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1647492</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2008/09/12/net-3-5-sp1-source-code.aspx#comments</comments><description>&lt;p&gt;When Visual Studio 2008 SP1 was released it didn’t have the source code for the framework like the original version of 2008 had. Well now it has !!&amp;#160; Actually &lt;a href="http://blogs.msdn.com/rscc/archive/2008/08/28/net-framework-3-5-sp1-sources-are-available.aspx" target="_blank"&gt;it was released almost two weeks ago&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1647492" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/Orcas/default.aspx">Orcas</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/CSharp/default.aspx">CSharp</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category></item><item><title>VS 2008 SDK available</title><link>http://msmvps.com/blogs/bill/archive/2008/08/21/vs-2008-sdk-available.aspx</link><pubDate>Thu, 21 Aug 2008 11:42:57 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1645355</guid><dc:creator>bill</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1645355</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2008/08/21/vs-2008-sdk-available.aspx#comments</comments><description>&lt;p&gt;I’ve been waiting for this update for VS 2008 SDK for VS 2008 SP1.&amp;#160; The link I got fro ma msdn blog post was wrong, so here’s the link to the download page. &lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.microsoft.com/downloads/details.aspx?FamilyID=59ec6ec3-4273-48a3-ba25-dc925a45584d&amp;amp;DisplayLang=en" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=59ec6ec3-4273-48a3-ba25-dc925a45584d&amp;amp;DisplayLang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=59ec6ec3-4273-48a3-ba25-dc925a45584d&amp;amp;DisplayLang=en&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; Enjoy.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1645355" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Unsubscribing events: How VB Handles it</title><link>http://msmvps.com/blogs/bill/archive/2008/08/21/unsubscribing-events-how-vb-handles-it.aspx</link><pubDate>Thu, 21 Aug 2008 11:40:39 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1645354</guid><dc:creator>bill</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/bill/rsscomments.aspx?PostID=1645354</wfw:commentRss><comments>http://msmvps.com/blogs/bill/archive/2008/08/21/unsubscribing-events-how-vb-handles-it.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://davybrion.com/blog/2008/08/why-you-should-always-unscubscribe-event-handlers/" target="_blank"&gt;Davy Brion posted&lt;/a&gt; about how events can keep object references alive.&amp;#160; In C# to rid yourself of this issue you have to manually unwire any event handler you wired.&amp;#160; In VB, it is a lot easier, all you have to do is use WithEvents and set the variable to nothing. This code is the VB version of Davy’s sample:&lt;/p&gt;  &lt;div style="font-size:11pt;background:white;color:black;font-family:consolas;"&gt;   &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:#3092b1;"&gt;Public&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Class&lt;/span&gt; Publisher&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Public&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Event&lt;/span&gt; MyEvent &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; EventHandler&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Public&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; FireEvent()&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;RaiseEvent&lt;/span&gt; MyEvent(&lt;span style="color:#3092b1;"&gt;Me&lt;/span&gt;, EventArgs.Empty)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Class&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:#3092b1;"&gt;Public&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Class&lt;/span&gt; GoodSubscriber&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Implements&lt;/span&gt; IDisposable&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Private&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;WithEvents&lt;/span&gt; _publisher &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; Publisher&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Public&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;New&lt;/span&gt;(&lt;span style="color:#3092b1;"&gt;ByVal&lt;/span&gt; publisher &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; Publisher)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _publisher = publisher&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Private&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; _publisher_MyEvent(&lt;span style="color:#3092b1;"&gt;ByVal&lt;/span&gt; sender &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Object&lt;/span&gt;, &lt;span style="color:#3092b1;"&gt;ByVal&lt;/span&gt; e &lt;span style="color:#3092b1;"&gt;As&lt;/span&gt; System.EventArgs) &lt;span style="color:#3092b1;"&gt;Handles&lt;/span&gt; _publisher.MyEvent&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Console.WriteLine(&lt;span style="background:#feffea;color:#a31515;"&gt;&amp;quot;the publisher notified the good subscriber of an event&amp;quot;&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;Public&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt; Dispose() &lt;span style="color:#3092b1;"&gt;Implements&lt;/span&gt; IDisposable.Dispose&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _publisher = &lt;span style="color:#3092b1;"&gt;Nothing&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&amp;#160; &lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Sub&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:#3092b1;"&gt;End&lt;/span&gt; &lt;span style="color:#3092b1;"&gt;Class&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:#3092b1;"&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin:0px;"&gt;&lt;span style="color:#3092b1;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;As long as the variable is declared as WithEvents any event wired up via declarative event handling will be unwired when the variable is set to Nothing.&lt;/p&gt;  &lt;p&gt;This is yet another subtle but important example of how declarative coding styles can lead to more robust code.&amp;#160; The above example is minimal, but when you get many events and many objects raising events, the cleanness of the VB way of handling it becomes even more important.&amp;#160; Or in other words in C# you have to make sure you unwire each and every event, in VB you use declarative events syntax and VB handles it for you ;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1645354" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/bill/archive/tags/VB/default.aspx">VB</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VB10/default.aspx">VB10</category><category domain="http://msmvps.com/blogs/bill/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://msmvps.com/blogs/bill/archive/tags/CSharp/default.aspx">CSharp</category><category domain="http://msmvps.com/blogs/bill/archive/tags/.NET/default.aspx">.NET</category></item></channel></rss>