<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results for 'app:weblogs' matching tag 'Visual Studio 2010'</title><link>http://msmvps.com/search/SearchResults.aspx?q=app:weblogs&amp;tag=Visual+Studio+2010&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:weblogs' matching tag 'Visual Studio 2010'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Visual Studio 2010 Beta 2 available for MSDN subscribers</title><link>http://msmvps.com/blogs/brianmadsen/archive/2009/10/20/visual-studio-2010-beta-2-available-for-msdn-subscribers.aspx</link><pubDate>Tue, 20 Oct 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1733534</guid><dc:creator>BrianMadsen</dc:creator><description>&lt;p&gt;Visual Studio 2010 Beta 2 – probably the most anticipated release of the VS family – has just hit a milestone. It’s reached the MSDN subscription downloads!&lt;/p&gt;  &lt;p&gt;VS2010 Beta 2 available to MSDN    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/bharry/archive/2009/10/19/vs-2010-beta-2-is-now-available-for-msdn-subscriber-download.aspx"&gt;http://blogs.msdn.com/bharry/archive/2009/10/19/vs-2010-beta-2-is-now-available-for-msdn-subscriber-download.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;VS2010 Licensing Changes    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/bharry/archive/2009/10/19/vs-2010-licensing-changes.aspx"&gt;http://blogs.msdn.com/bharry/archive/2009/10/19/vs-2010-licensing-changes.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;4 new SKUs, Express, Professional, Premium, Ultimate &lt;/p&gt;  &lt;p&gt;What’s new in VS2010 and Learning about VS2010    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/bharry/archive/2009/10/19/learning-about-vs-2010-beta-2.aspx"&gt;http://blogs.msdn.com/bharry/archive/2009/10/19/learning-about-vs-2010-beta-2.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;TFS 2010 Compatibility with older clients    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/bharry/archive/2009/10/19/tfs-2010-compatibility-with-older-clients.aspx"&gt;http://blogs.msdn.com/bharry/archive/2009/10/19/tfs-2010-compatibility-with-older-clients.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Visual Studio 2010 Beta 2 will be available to the public on the 21st of October, 2009 (for those not endowed with a MSDN subscription)&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Visual Studio 2010 Beta 2 released</title><link>http://msmvps.com/blogs/joacim/archive/2009/10/20/visual-studio-2010-beta-2-released.aspx</link><pubDate>Tue, 20 Oct 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1733611</guid><dc:creator>Joacim</dc:creator><description>&lt;p&gt;Yesterday Microsoft had a big announcement day. At the same time as Steve Ballmer held his keynotes at the &lt;a href="http://www.mssharepointconference.com/pages/default.aspx" target="_blank"&gt;SharePoint Developers Conference&lt;/a&gt; (see the &lt;a href="http://www.mssharepointconference.com/pages/default.aspx" target="_blank"&gt;video&lt;/a&gt;) Microsoft released Visual Studio 2010 Beta 2 for MSDN subscribers, the public release will be tomorrow, October 21st. They also &lt;a href="http://blogs.msdn.com/somasegar/archive/2009/10/19/announcing-visual-studio-2010-and-net-fx-4-beta-2.aspx" target="_blank"&gt;announced that the official release date of Visual Studio 2010 and the .Net 4.0 Framework will be on March 22nd, 2010&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/joacim.metablogapi/4353.image_5F00_4D73D52B.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;margin-left:0px;border-top:0px;margin-right:0px;border-right:0px;" title="Visual Studio logo" border="0" alt="Visual Studio logo" align="right" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/joacim.metablogapi/5417.image_5F00_thumb_5F00_56EC93A1.png" width="261" height="39" /&gt;&lt;/a&gt; Visual Studio has been given a new blue-purple logo and at the same time the &lt;a href="http://msdn.microsoft.com/" target="_blank"&gt;MSDN web site&lt;/a&gt; has also been given a face lift using this blue-purple color scheme. If you have visited the &lt;a href="http://msdn.microsoft.com/vbasic" target="_blank"&gt;Visual Basic Developer Center&lt;/a&gt; recently you may have already seen the preview of the new MSDN look. In my opinion it’s much nicer compared to the old red color scheme it had before.&lt;/p&gt;  &lt;p&gt;With the beta release Microsoft also released &lt;a href="http://msdn.microsoft.com/en-us/sharepoint/default.aspx" target="_blank"&gt;Visual Studio 2010 Tools for SharePoint&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Microsoft have compiled a lot of 2010 resources on the VB and C# Developer Centers: &lt;a href="http://msdn.microsoft.com/en-us/vbasic/dd819153.aspx" target="_blank"&gt;VB 2010 Resources&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/vcsharp/dd819407.aspx" target="_blank"&gt;C# 2010 Resources&lt;/a&gt;. They have also released a number of &lt;em&gt;How do I&lt;/em&gt; videos. &lt;strong&gt;Note&lt;/strong&gt;, the first two links will be available very soon, if they aren’t already.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;How Do I: &lt;a href="http://msdn.microsoft.com/vbasic/ee681550.aspx" target="_blank"&gt;Use auto-implemented properties?&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;How Do I: &lt;a href="http://msdn.microsoft.com/vbasic/ee681551.aspx" target="_blank"&gt;Use implicit line continuations in VB 10?&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;How Do I: &lt;a href="http://msdn.microsoft.com/en-us/vcsharp/ee625744.aspx" target="_blank"&gt;Use highlight reference in the Visual Studio 2010 IDE?&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;How Do I: &lt;a href="http://msdn.microsoft.com/en-us/vcsharp/ee625748.aspx" target="_blank"&gt;Use Code Snippets in the Visual Studio IDE?&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;How Do I: &lt;a href="http://msdn.microsoft.com/en-us/vcsharp/ee633445.aspx" target="_blank"&gt;Use Generate from Usage in Visual Studio 2010?&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;How Do I: &lt;a href="http://msdn.microsoft.com/en-us/vstudio/ee681649.aspx" target="_blank"&gt;Enhance performance in the Visual Studio 2010 IDE when editing VB code?&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;How Do I: &lt;a href="http://msdn.microsoft.com/en-us/vcsharp/ee672313.aspx" target="_blank"&gt;Step with the debugger in Visual Studio?&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;How Do I: Refactor my code in Visual Studio (&lt;a href="http://msdn.microsoft.com/en-us/vbasic/ee672318.aspx" target="_blank"&gt;Part 1&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/vstudio/ee675607.aspx" target="_blank"&gt;Part 2&lt;/a&gt;)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I have looked forward to this beta release for a long time now, even though I have used Beta 1 since it was released back in May, beta 2 is much more promising simply because everything should be in place by now. Microsoft will probably not add any new features but rather just fix any bugs that are reported and concentrate on performance issues. So I can now start doing some real world testing and finally concentrate on to fully learn the new features of the framework. This of course also means that you can expect to see a lot more posts about VS2010 on this blog in the near future.&lt;/p&gt;  &lt;p&gt;Have fun, I know I will. :)&lt;/p&gt;</description></item><item><title>New Features in Visual Studio 2010</title><link>http://msmvps.com/blogs/nunogodinho/archive/2009/09/07/new-features-in-visual-studio-2010.aspx</link><pubDate>Mon, 07 Sep 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1721443</guid><dc:creator>NunoGodinho</dc:creator><description>&lt;p&gt;Visual Studio 2010 is approaching rapidly from the launch and with it a new set of features will also appear.&lt;/p&gt;  &lt;p&gt;One that I think is very important is the Architectural Tools that come with this new version, and elements like:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Dependency Graph      &lt;ul&gt;       &lt;li&gt;Filters using Direct Graph Markup Language (DGML) on top of the generated graph. &lt;/li&gt;        &lt;li&gt;Views as:          &lt;ul&gt;           &lt;li&gt;Dependency Matrix &lt;/li&gt;            &lt;li&gt;Forced Direct Layout &lt;/li&gt;            &lt;li&gt;Top to Bottom Layout &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Sequence Diagrams      &lt;ul&gt;       &lt;li&gt;Available on the Code Editor &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Unified Modeling Language (UML)      &lt;ul&gt;       &lt;li&gt;Usage of UML to define the project &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Use Cases (UC)      &lt;ul&gt;       &lt;li&gt;Creation of Use Cases &lt;/li&gt;        &lt;li&gt;Integration with TFS, since we can select an element in the use case and build, link or View the associated Work Items. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Layer Designer and Layer Validation      &lt;ul&gt;       &lt;li&gt;Possibility do build the Architecture of the solution and associate some validation elements that will always be enforced during the development process. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&amp;#160; To know more about this &lt;a href="http://blogs.msdn.com/somasegar/archive/2009/08/29/architecture-tools-in-vsts-2010.aspx" target="_blank"&gt;subject read this S.Somasegar post&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Another very important features are the Debugging and Profiling.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Debugging      &lt;ul&gt;       &lt;li&gt;Built in Debugger for MPI programs. Now with the new VS2010 we can select a cluster head node, how many cores you want, and hit F5 to debug your MPI program. &lt;/li&gt;        &lt;li&gt;SOA Debugging          &lt;ul&gt;           &lt;li&gt;Up until now, debugging Cluster SOA was limited to basic WCF/.Net style debugging with no cluster integration. &lt;/li&gt;            &lt;li&gt;In Visual Studio 2010, an add-in for Cluster SOA enables the SOA Settings tab, allowing you to choose a head node, debug nodes and services, deploy runtime libraries and clean up automatically. &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Profiling      &lt;ul&gt;       &lt;li&gt;VS Profiler can offer insight into performance issues &lt;/li&gt;        &lt;li&gt;Shows a comparison report across multiple runs or builds so you can easily see the effect of your changes. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; To know more about this &lt;a href="http://blogs.msdn.com/somasegar/archive/2009/08/07/debugging-profiling-and-analyzing-parallel-applications.aspx" target="_blank"&gt;subject read this S. Somasegar post&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Interesting reading about Entity Framework 4.0</title><link>http://msmvps.com/blogs/nunogodinho/archive/2009/07/06/interesting-reading-about-entity-framework-4-0.aspx</link><pubDate>Mon, 06 Jul 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1698491</guid><dc:creator>NunoGodinho</dc:creator><description>&lt;p&gt;Entity Framework has suffered great changes and in order to know more about them I recommend the following reading:&lt;/p&gt;  &lt;p&gt;POCO (&lt;strong&gt;P&lt;/strong&gt;lain &lt;strong&gt;O&lt;/strong&gt;ld &lt;strong&gt;C&lt;/strong&gt;LR &lt;strong&gt;O&lt;/strong&gt;bject or Persistence ) in the Entity Framework 4.0&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/archive/2009/05/11/sneak-preview-persistence-ignorance-and-poco-in-entity-framework-4-0.aspx" target="_blank"&gt;Sneak Preview: Persistence Ignorance and POCO in Entity Framework 4.0&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;POCO in the Entity Framework: &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;“Why is POCO important in Entity Framework? Is important because now we have the ability to really separate the Storage Model from the Conceptual Model, and being the Conceptual Model our &lt;strong&gt;normal&lt;/strong&gt; CLR Objects, that was not possible in previous versions of Entity Framework. This is a huge breakthrough for this 4.0 version. Is not perfect, and in this technologies it never is but it’s very interesting”&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;ol&gt;     &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/archive/2009/05/21/poco-in-the-entity-framework-part-1-the-experience.aspx" target="_blank"&gt;Part 1 - The Experience&lt;/a&gt; (Explains how to make this two parts of the POCO experience with Entity Framework 4.0, from making the Model to the designing of the POCO entities, as well as answering some interesting questions)&lt;/li&gt;      &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/archive/2009/05/28/poco-in-the-entity-framework-part-2-complex-types-deferred-loading-and-explicit-loading.aspx" target="_blank"&gt;Part 2 – Complex Types, Deferred Loading and Explicit Loading&lt;/a&gt; (Goes further in the POCO entities and make changes shows how to implement Complex Types as well as configuring the Loading by using Deferred/Lazy Loading or Explicit Loading)&lt;/li&gt;      &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/archive/2009/06/10/poco-in-the-entity-framework-part-3-change-tracking-with-poco.aspx" target="_blank"&gt;Part 3 – Change Tracking with POCO&lt;/a&gt; (Explains furthermore how the Change Tracking, that is so important in Entity Framework, works in POCO entities and how can it be configured by using Metadata) &lt;/li&gt;   &lt;/ol&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/archive/2009/06/16/using-repository-and-unit-of-work-patterns-with-entity-framework-4-0.aspx" target="_blank"&gt;Using Repository and Unit of Work patterns with Entity Framework 4.0&lt;/a&gt; (Explains how to implement common patterns like &lt;a href="http://martinfowler.com/eaaCatalog/repository.html" target="_blank"&gt;Repository&lt;/a&gt; and &lt;a href="http://www.martinfowler.com/eaaCatalog/unitOfWork.html" target="_blank"&gt;Unit of Work&lt;/a&gt; using Entity Framework 4.0) &lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/archive/2009/06/22/announcing-entity-framework-feature-ctp-1.aspx" target="_blank"&gt;Entity Framework Feature CTP 1&lt;/a&gt; (Announcement of the Entity Framework CTP Features for .NET 4.0 Beta 1)&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-self-tracking-entities-for-the-entity-framework.aspx" target="_blank"&gt;Feature CTP Walkthrough: Self Tracking Entities for Entity Framework&lt;/a&gt; (Explains the scenarios on where to use the Self Tracking Entities)&lt;/li&gt;      &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-poco-templates-for-the-entity-framework.aspx" target="_blank"&gt;Feature CTP Walkthrough: POCO Templates for Entity Framework&lt;/a&gt; (Explains how to use POCO Templates, that is a kind of T4 Template in order to generate POCO entities)&lt;/li&gt;      &lt;li&gt;&lt;a href="http://blogs.msdn.com/adonet/pages/feature-ctp-walkthrough-code-only-for-the-entity-framework.aspx" target="_blank"&gt;Feature CTP Walkthrough: Code Only for Entity Framework&lt;/a&gt; (Explains how to Entity Framework without any model like EDMX, just code)&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;I hope you enjoy the reading.&lt;/p&gt;</description></item><item><title>Microsoft Releases Roadmap</title><link>http://msmvps.com/blogs/nunogodinho/archive/2009/06/03/microsoft-releases-roadmap.aspx</link><pubDate>Wed, 03 Jun 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1693750</guid><dc:creator>NunoGodinho</dc:creator><description>&lt;p&gt;A lot is being announced this days regarding Microsoft Products and Technologies, and so this is a little summary of all those information&amp;#39;s.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.neowin.net/news/main/09/05/29/microsoft-confirms-silverlight-3-to-launch-on-july-10" target="_blank"&gt;Silverlight 3.0 – July 10th 2009&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.azurejournal.com/2009/04/why-microsoft-wont-release-windows-azure-this-year-but-they-should/" target="_blank"&gt;Azure Business Model – In the next few weeks/months&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.microsoft.com/presspass/features/2009/Jun09/06-02SteveGuggenheimer.mspx" target="_blank"&gt;Windows 7 – October 22nd 2009&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.sedodream.com/PermaLink,guid,01de7e0f-8fbc-4ea3-ac0b-45830ce12da1.aspx" target="_blank"&gt;Visual Studio 2010 and .NET Framework 4.0 – Last Quarter of 2009&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.computerworld.com/action/article.do?command=viewArticleBasic&amp;amp;articleId=9128520" target="_blank"&gt;Azure RTM – Last Quarter of 2009&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.microsoft.com/presspass/features/2009/Apr09/04-15Office2010.mspx?rss_fdn=Top%20Stories" target="_blank"&gt;Office 2010 – First Half 2010&lt;/a&gt;       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.findmysoft.com/news/Microsoft-Announces-Office-2010-codename-Office-14-Release-Date/" target="_blank"&gt;Exchange Server 2010 – Second Half 2009&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.findmysoft.com/news/Microsoft-Announces-Office-2010-codename-Office-14-Release-Date/" target="_blank"&gt;Office 2010 System – First Half 2010&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;</description></item><item><title>Exploiting covariance with LINQ to XML</title><link>http://msmvps.com/blogs/martin_honnen/archive/2009/06/01/exploiting-covariance-with-linq-to-xml.aspx</link><pubDate>Mon, 01 Jun 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1693522</guid><dc:creator>MartinH</dc:creator><description>&lt;p&gt;In my &lt;a href="http://msmvps.com/blogs/martin_honnen/archive/2009/05/31/exploiting-contravariance-with-linq-to-xml.aspx"&gt;last post&lt;/a&gt; I showed how the &lt;a href="http://msdn.microsoft.com/en-us/library/dd465120(VS.100).aspx"&gt;new contravariance feature in .NET 4.0/Visual Studio 2010 for type parameters of generic interfaces&lt;/a&gt; makes coding with LINQ to XML easier and more straightforward. In this post I will show how the &lt;a href="http://msdn.microsoft.com/en-us/library/9eekhta0(VS.100).aspx"&gt;covariance of the type parameter T of IEnumerable&amp;lt;T&amp;gt;&lt;/a&gt; also allows us to write LINQ to XML queries in a more straightforward way.&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s assume we have the following XML document:&lt;/p&gt;
&lt;pre&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:red;"&gt;version&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;1.0&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:red;"&gt;encoding&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;utf-8&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:blue;"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;root&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:blue;"&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="color:green;"&gt; comment 1 --&amp;gt;&lt;br /&gt;  &amp;lt;foo&amp;gt;foo 1&amp;lt;/foo&amp;gt;&lt;br /&gt;  &amp;lt;bar&amp;gt;bar 1&amp;lt;/bar&amp;gt;&lt;br /&gt;  &amp;lt;!-- comment 2 --&amp;gt;&lt;br /&gt;  &amp;lt;foo&amp;gt;foo 2&amp;lt;/foo&amp;gt;&lt;br /&gt;  &amp;lt;bar&amp;gt;2&amp;lt;/bar&amp;gt;&lt;br /&gt;  &amp;lt;!-- comment 3 &lt;/span&gt;&lt;span style="color:blue;"&gt;--&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;root&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;and we want to transform that document into a second one with the same root element having the same child nodes, except where all &amp;#39;bar&amp;#39; child elements of the &amp;#39;root&amp;#39; element node have been removed. So the result should look as follows:&lt;/p&gt;
&lt;pre&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:red;"&gt;version&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;1.0&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:red;"&gt;encoding&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;utf-8&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:blue;"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;root&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:blue;"&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="color:green;"&gt; comment 1 --&amp;gt;&lt;br /&gt;  &amp;lt;foo&amp;gt;foo 1&amp;lt;/foo&amp;gt;&lt;br /&gt;  &amp;lt;!-- comment 2 --&amp;gt;&lt;br /&gt;  &amp;lt;foo&amp;gt;foo 2&amp;lt;/foo&amp;gt;&lt;br /&gt;  &amp;lt;!-- comment 3 &lt;/span&gt;&lt;span style="color:blue;"&gt;--&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;root&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;A first attempt to achieve that with LINQ to XML could look as follows:&lt;/p&gt;
&lt;pre&gt;            XDocument doc1 = XDocument.Load(&lt;span style="color:#a31515;"&gt;@&amp;quot;XMLFile1.xml&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;            XDocument doc2 =&lt;br /&gt;                &lt;span style="color:blue;"&gt;new&lt;/span&gt; XDocument(&lt;br /&gt;                    &lt;span style="color:blue;"&gt;new&lt;/span&gt; XElement(doc1.Root.Name,&lt;br /&gt;                        doc1&lt;br /&gt;                        .Root&lt;br /&gt;                        .Nodes()&lt;br /&gt;                        .Except(&lt;br /&gt;                            doc1&lt;br /&gt;                            .Root&lt;br /&gt;                            .Elements(&lt;span style="color:#a31515;"&gt;&amp;quot;bar&amp;quot;&lt;/span&gt;))));&lt;br /&gt;&lt;br /&gt;            doc2.Save(Console.Out);&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;So we create a new XDocument with a new root XElement having the same name as the Root of the first XDocument where all child nodes except of the &amp;#39;bar&amp;#39; child elements are copied. &lt;/p&gt;
&lt;p&gt;Looks nice and straightforward only if you try to compile that with Visual Studio 2008/.NET 3.5 you get the following error: &amp;quot;Argument &amp;#39;2&amp;#39;: cannot convert from &amp;#39;System.Collections.Generic.IEnumerable&amp;lt;System.Xml.Linq.XElement&amp;gt;&amp;#39; to &amp;#39;System.Collections.Generic.IEnumerable&amp;lt;System.Xml.Linq.XNode&amp;gt;&amp;#39;&amp;quot;. &lt;/p&gt;
&lt;p&gt;The problem is that the Nodes() call returns an IEnumerable&amp;lt;XNode&amp;gt; and then the following Except() call also needs an IEnumerable&amp;lt;XNode&amp;gt; as its argument while Elements(&amp;quot;bar&amp;quot;) gives us an IEnumerable&amp;lt;XElement&amp;gt;. With generic interfaces being invariant in .NET 3.5 we can&amp;#39;t pass that IEnumerable&amp;lt;XElement&amp;gt; in for an IEnumerable&amp;lt;XNode&amp;gt;, although XElement is a class derived from XNode.&lt;/p&gt;
&lt;p&gt;As a workaround we can first cast the IEnumerable&amp;lt;XElement&amp;gt; to an IEnumerable&amp;lt;XNode&amp;gt;:&lt;/p&gt;
&lt;pre&gt;            XDocument doc1 = XDocument.Load(&lt;span style="color:#a31515;"&gt;@&amp;quot;XMLFile1.xml&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;            XDocument doc2 =&lt;br /&gt;                &lt;span style="color:blue;"&gt;new&lt;/span&gt; XDocument(&lt;br /&gt;                    &lt;span style="color:blue;"&gt;new&lt;/span&gt; XElement(doc1.Root.Name,&lt;br /&gt;                        doc1&lt;br /&gt;                        .Root&lt;br /&gt;                        .Nodes()&lt;br /&gt;                        .Except(&lt;br /&gt;                            doc1&lt;br /&gt;                            .Root&lt;br /&gt;                            .Elements(&lt;span style="color:#a31515;"&gt;&amp;quot;bar&amp;quot;&lt;/span&gt;)&lt;br /&gt;                            .Cast&amp;lt;XNode&amp;gt;())));&lt;br /&gt;&lt;br /&gt;            doc2.Save(Console.Out);&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;That way it compiles fine and produces the wanted result with .NET 3.5, only it seems desirable that you would not need that Cast&amp;lt;XNode&amp;gt;() call.&lt;/p&gt;
&lt;p&gt;The good news is that starting with .NET 4.0 the type parameter T of IEnumerable&amp;lt;T&amp;gt; is covariant meaning where an IEnumerable&amp;lt;T&amp;gt; of a certain type T is expected we can always pass in an IEnumerable&amp;lt;T2&amp;gt; where T2 is type derived from T, as in our example where XElement is a subclass of XNode (or subsubclass to be precise).&lt;/p&gt;
&lt;p&gt;Thus with .NET 4.0 the following compiles and works fine:&lt;/p&gt;
&lt;pre&gt;            XDocument doc1 = XDocument.Load(&lt;span style="color:#a31515;"&gt;@&amp;quot;XMLFile1.xml&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;            XDocument doc2 =&lt;br /&gt;                &lt;span style="color:blue;"&gt;new&lt;/span&gt; XDocument(&lt;br /&gt;                    &lt;span style="color:blue;"&gt;new&lt;/span&gt; XElement(doc1.Root.Name,&lt;br /&gt;                        doc1&lt;br /&gt;                        .Root&lt;br /&gt;                        .Nodes()&lt;br /&gt;                        .Except(&lt;br /&gt;                            doc1&lt;br /&gt;                            .Root&lt;br /&gt;                            .Elements(&lt;span style="color:#a31515;"&gt;&amp;quot;bar&amp;quot;&lt;/span&gt;))));&lt;br /&gt;&lt;br /&gt;            doc2.Save(Console.Out);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Exploiting contravariance with LINQ to XML</title><link>http://msmvps.com/blogs/martin_honnen/archive/2009/05/31/exploiting-contravariance-with-linq-to-xml.aspx</link><pubDate>Sun, 31 May 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1693493</guid><dc:creator>MartinH</dc:creator><description>&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd233054(VS.100).aspx"&gt;Covariance and contravariance for generic interfaces are new features in C# and VB.NET&lt;/a&gt; in Visual Studio 2010 respectively the .NET framework 4.0. Generic interfaces like IEnumerable&amp;lt;T&amp;gt; or IEqualityComparer&amp;lt;T&amp;gt; in the .NET framework 4.0 use these new features. Starting with .NET 4.0 the type parameter T in &lt;a href="http://msdn.microsoft.com/en-us/library/ms132151(VS.100).aspx"&gt;IEqualityComparer&amp;lt;T&amp;gt;&lt;/a&gt; is contravariant. That can make coding with LINQ to XML easier, as the class &lt;a href="http://msdn.microsoft.com/en-us/library/system.xml.linq.xnodeequalitycomparer(VS.100).aspx"&gt;XNodeEqualityComparer&lt;/a&gt; implements IEqualityComparer&amp;lt;XNode&amp;gt; where XNode is a common base class for other LINQ to XML classes like XElement.&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s look at an example. Assume we have the following XML document&lt;/p&gt;
&lt;pre&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:red;"&gt;version&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;1.0&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:red;"&gt;encoding&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;utf-8&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt; &lt;span style="color:blue;"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;root&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;items&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;item&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;foo&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;a&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;foo&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;bar&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;bar&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;item&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;item&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;foo&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;b&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;foo&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;bar&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;2&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;bar&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;item&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;item&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;foo&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;a&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;foo&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;bar&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;bar&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;item&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;item&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;foo&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;c&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;foo&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;bar&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;bar&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;item&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;item&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;foo&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;c&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;foo&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;bar&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;bar&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;item&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;items&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;root&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;and we want to use LINQ to XML to extract distinct items where we use XNodeEqualityComparer to compare the &amp;#39;item&amp;#39; elements in the XML document.&lt;/p&gt;
&lt;p&gt;You could be tempted to try it as follows:&lt;/p&gt;
&lt;pre&gt;            XDocument doc = XDocument.Load(&lt;span style="color:#a31515;"&gt;&amp;quot;XMLFile1.xml&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;            var distinctItems =&lt;br /&gt;                doc&lt;br /&gt;                .Root&lt;br /&gt;                .Element(&lt;span style="color:#a31515;"&gt;&amp;quot;items&amp;quot;&lt;/span&gt;)&lt;br /&gt;                .Elements(&lt;span style="color:#a31515;"&gt;&amp;quot;item&amp;quot;&lt;/span&gt;)&lt;br /&gt;                .Distinct(&lt;span style="color:blue;"&gt;new&lt;/span&gt; XNodeEqualityComparer())&lt;br /&gt;                .Select(i =&amp;gt; &lt;span style="color:blue;"&gt;new&lt;/span&gt; { foo = (&lt;span style="color:blue;"&gt;string&lt;/span&gt;)i.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;foo&amp;quot;&lt;/span&gt;), bar = (&lt;span style="color:blue;"&gt;int&lt;/span&gt;)i.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;bar&amp;quot;&lt;/span&gt;) });&lt;br /&gt;&lt;br /&gt;            &lt;span style="color:blue;"&gt;foreach&lt;/span&gt; (var item &lt;span style="color:blue;"&gt;in&lt;/span&gt; distinctItems)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine(item);&lt;br /&gt;            }&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;but with .NET 3.5 that does not compile, complaining &amp;quot;Instance argument: cannot convert from &amp;#39;System.Collections.Generic.IEnumerable&amp;lt;System.Xml.Linq.XElement&amp;gt;&amp;#39; to &amp;#39;System.Collections.Generic.IEnumerable&amp;lt;System.Xml.Linq.XNode&amp;gt;&amp;#39;&amp;quot; on the Distinct(new XNodeEqualityComparer()) call. That happens because Elements(&amp;quot;item&amp;quot;) gives us an IEnumerable&amp;lt;XElement&amp;gt; and subsequently the Distinct method wants an IEqualityComparer&amp;lt;XElement&amp;gt; to be passed in while we only pass in an IEqualityComparer&amp;lt;XNode&amp;gt;. &lt;/p&gt;
&lt;p&gt;With .NET 3.5 to work around that problem we first have to cast IEnumerable&amp;lt;XElement&amp;gt; up to IEnumerable&amp;lt;XNode&amp;gt; before we call Distinct(new XNodeEqualityComparer()) and then down again after the Distinct() call:&lt;/p&gt;
&lt;pre&gt;            XDocument doc = XDocument.Load(&lt;span style="color:#a31515;"&gt;&amp;quot;XMLFile1.xml&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;            var distinctItems =&lt;br /&gt;                doc&lt;br /&gt;                .Root&lt;br /&gt;                .Element(&lt;span style="color:#a31515;"&gt;&amp;quot;items&amp;quot;&lt;/span&gt;)&lt;br /&gt;                .Elements(&lt;span style="color:#a31515;"&gt;&amp;quot;item&amp;quot;&lt;/span&gt;)&lt;br /&gt;                .Cast&amp;lt;XNode&amp;gt;()&lt;br /&gt;                .Distinct(&lt;span style="color:blue;"&gt;new&lt;/span&gt; XNodeEqualityComparer())&lt;br /&gt;                .Cast&amp;lt;XElement&amp;gt;()&lt;br /&gt;                .Select(i =&amp;gt; &lt;span style="color:blue;"&gt;new&lt;/span&gt; { foo = (&lt;span style="color:blue;"&gt;string&lt;/span&gt;)i.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;foo&amp;quot;&lt;/span&gt;), bar = (&lt;span style="color:blue;"&gt;int&lt;/span&gt;)i.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;bar&amp;quot;&lt;/span&gt;) });&lt;br /&gt;&lt;br /&gt;            &lt;span style="color:blue;"&gt;foreach&lt;/span&gt; (var item &lt;span style="color:blue;"&gt;in&lt;/span&gt; distinctItems)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine(item);&lt;br /&gt;            }&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;That compiles fine and nicely returns only distinct items:&lt;/p&gt;
&lt;p&gt;{ foo = a, bar = 1 }&lt;br /&gt;{ foo = b, bar = 2 }&lt;br /&gt;{ foo = c, bar = 3 }&lt;/p&gt;
&lt;p&gt;With .NET 4.0 however the type parameter T of IEqualityComparer is contravariant meaning if we have a method expecting an IEqualityComparer&amp;lt;XElement&amp;gt; it suffices to use a base type of XElement like XNode and thus with .NET 4.0 our original attempt compiles and runs fine:&lt;/p&gt;
&lt;pre&gt;            XDocument doc = XDocument.Load(&lt;span style="color:#a31515;"&gt;&amp;quot;XMLFile1.xml&amp;quot;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;            var distinctItems =&lt;br /&gt;                doc&lt;br /&gt;                .Root&lt;br /&gt;                .Element(&lt;span style="color:#a31515;"&gt;&amp;quot;items&amp;quot;&lt;/span&gt;)&lt;br /&gt;                .Elements(&lt;span style="color:#a31515;"&gt;&amp;quot;item&amp;quot;&lt;/span&gt;)&lt;br /&gt;                .Distinct(&lt;span style="color:blue;"&gt;new&lt;/span&gt; XNodeEqualityComparer())&lt;br /&gt;                .Select(i =&amp;gt; &lt;span style="color:blue;"&gt;new&lt;/span&gt; { foo = (&lt;span style="color:blue;"&gt;string&lt;/span&gt;)i.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;foo&amp;quot;&lt;/span&gt;), bar = (&lt;span style="color:blue;"&gt;int&lt;/span&gt;)i.Element(&lt;span style="color:#a31515;"&gt;&amp;quot;bar&amp;quot;&lt;/span&gt;) });&lt;br /&gt;&lt;br /&gt;            &lt;span style="color:blue;"&gt;foreach&lt;/span&gt; (var item &lt;span style="color:blue;"&gt;in&lt;/span&gt; distinctItems)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine(item);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>What is new in System.Xml in .NET 4.0/Visual Studio 2010</title><link>http://msmvps.com/blogs/martin_honnen/archive/2009/05/21/what-is-new-in-system-xml-in-net-4-0-visual-studio-2010.aspx</link><pubDate>Thu, 21 May 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1693044</guid><dc:creator>MartinH</dc:creator><description>&lt;p&gt;Beta 1 of the .NET framework 4.0 and of Visual Studio 2010 has been released a few days ago. Although the &lt;a href="http://msdn.microsoft.com/en-us/library/dd409230(VS.100).aspx"&gt;&amp;quot;What&amp;#39;s new&amp;quot; document&lt;/a&gt; does not list any new features in System.Xml or LINQ to XML I am browsing through the documentation to find new features or changes in APIs.&lt;/p&gt;
&lt;p&gt;So far I have found the following:&lt;/p&gt;
&lt;p&gt;With LINQ to XML the &lt;a href="http://msdn.microsoft.com/en-us/library/system.xml.linq.saveoptions(VS.100).aspx"&gt;SaveOptions enumeration&lt;/a&gt; has a new flag named OmitDuplicateNamespaces. That is particularly useful with VB.NET XML literals as using them you might end up with more namespace declaration attributes as you want resulting in superfluous namespace declarations on child or descendant elements when you save/serialize a LINQ to XML XDocument or XElement.&lt;/p&gt;
&lt;p&gt;Here is an example in VB.NET with .NET 3.5:&lt;/p&gt;
&lt;pre&gt;&lt;span style="color:blue;"&gt;Imports&lt;/span&gt; System&lt;br /&gt;&lt;span style="color:blue;"&gt;Imports&lt;/span&gt; System.Xml.Linq&lt;br /&gt;&lt;span style="color:blue;"&gt;Imports&lt;/span&gt; &amp;lt;xmlns=&lt;span style="color:#a31515;"&gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;Module&lt;/span&gt; Module1&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; Main()&lt;br /&gt;        &lt;span style="color:blue;"&gt;Dim&lt;/span&gt; html &lt;span style="color:blue;"&gt;As&lt;/span&gt; XElement = _&lt;br /&gt;        &amp;lt;html&amp;gt;&lt;br /&gt;            &amp;lt;head&amp;gt;&lt;br /&gt;                &amp;lt;title&amp;gt;Example&amp;lt;/title&amp;gt;&lt;br /&gt;            &amp;lt;/head&amp;gt;&lt;br /&gt;            &amp;lt;body&amp;gt;&lt;br /&gt;            &amp;lt;/body&amp;gt;&lt;br /&gt;        &amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;        html.&amp;lt;body&amp;gt;(0).Add(GetParagraphs())&lt;br /&gt;&lt;br /&gt;        html.Save(Console.Out)&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;Function&lt;/span&gt; GetParagraphs() &lt;span style="color:blue;"&gt;As&lt;/span&gt; IEnumerable(Of XElement)&lt;br /&gt;        &lt;span style="color:blue;"&gt;Dim&lt;/span&gt; ps() &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;String&lt;/span&gt; = {&lt;span style="color:#a31515;"&gt;&amp;quot;Paragraph 1.&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;Paragraph 2.&amp;quot;&lt;/span&gt;}&lt;br /&gt;        &lt;span style="color:blue;"&gt;Return&lt;/span&gt; (From p &lt;span style="color:blue;"&gt;In&lt;/span&gt; ps &lt;span style="color:blue;"&gt;Select&lt;/span&gt; &amp;lt;p&amp;gt;&amp;lt;%= p %&amp;gt;&amp;lt;/p&amp;gt;)&lt;br /&gt;    &lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Module&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;Its output is as follows:&lt;/p&gt;
&lt;pre&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;html&lt;/span&gt; &lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;http://www.w3.org/1999/xhtml&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;head&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Example&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;head&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;body&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;p&lt;/span&gt; &lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;http://www.w3.org/1999/xhtml&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Paragraph 1.&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;p&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;p&lt;/span&gt; &lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;http://www.w3.org/1999/xhtml&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Paragraph 2.&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;p&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;body&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;html&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you can see, the namespace declarations on the &amp;#39;p&amp;#39; elements are redundant as the namespace is already defined on the &amp;#39;html&amp;#39; root element.&lt;/p&gt;
&lt;p&gt;With .NET 4.0 and the SaveOptions.OmitDuplicateNamespaces flag you can avoid them as follows:&lt;/p&gt;
&lt;pre&gt;&lt;span style="color:blue;"&gt;Imports&lt;/span&gt; System&lt;br /&gt;&lt;span style="color:blue;"&gt;Imports&lt;/span&gt; System.Xml.Linq&lt;br /&gt;&lt;span style="color:blue;"&gt;Imports&lt;/span&gt; &amp;lt;xmlns=&lt;span style="color:#a31515;"&gt;&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;Module&lt;/span&gt; Module1&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;Sub&lt;/span&gt; Main()&lt;br /&gt;        &lt;span style="color:blue;"&gt;Dim&lt;/span&gt; html &lt;span style="color:blue;"&gt;As&lt;/span&gt; XElement = _&lt;br /&gt;        &amp;lt;html&amp;gt;&lt;br /&gt;            &amp;lt;head&amp;gt;&lt;br /&gt;                &amp;lt;title&amp;gt;Example&amp;lt;/title&amp;gt;&lt;br /&gt;            &amp;lt;/head&amp;gt;&lt;br /&gt;            &amp;lt;body&amp;gt;&lt;br /&gt;            &amp;lt;/body&amp;gt;&lt;br /&gt;        &amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;        html.&amp;lt;body&amp;gt;(0).Add(GetParagraphs())&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        html.Save(Console.Out, SaveOptions.OmitDuplicateNamespaces)&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;Function&lt;/span&gt; GetParagraphs() &lt;span style="color:blue;"&gt;As&lt;/span&gt; IEnumerable(Of XElement)&lt;br /&gt;        &lt;span style="color:blue;"&gt;Dim&lt;/span&gt; ps() &lt;span style="color:blue;"&gt;As&lt;/span&gt; &lt;span style="color:blue;"&gt;String&lt;/span&gt; = {&lt;span style="color:#a31515;"&gt;&amp;quot;Paragraph 1.&amp;quot;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&amp;quot;Paragraph 2.&amp;quot;&lt;/span&gt;}&lt;br /&gt;        &lt;span style="color:blue;"&gt;Return&lt;/span&gt; (From p &lt;span style="color:blue;"&gt;In&lt;/span&gt; ps &lt;span style="color:blue;"&gt;Select&lt;/span&gt; &amp;lt;p&amp;gt;&amp;lt;%= p %&amp;gt;&amp;lt;/p&amp;gt;)&lt;br /&gt;    &lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;End&lt;/span&gt; &lt;span style="color:blue;"&gt;Module&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;
Now the output is fine:&lt;/p&gt;
&lt;pre&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;html&lt;/span&gt; &lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;http://www.w3.org/1999/xhtml&lt;/span&gt;&lt;span style="color:black;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;head&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Example&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;head&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;body&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;p&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Paragraph 1.&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;p&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;p&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Paragraph 2.&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;p&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;body&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;html&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;Have you ever wondered why an XDocument or XElement in .NET 3.5 could be saved to a TextWriter or a file or an XmlWriter but not directly to a Stream? In .NET 3.5 you need to construct an XmlWriter or TextWriter over a Stream but now in .NET 4.0 you can save directly to a Stream: &lt;a href="http://msdn.microsoft.com/en-us/library/cc838476(VS.100).aspx"&gt;XDocument.Save(Stream)&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/cc838604(VS.100).aspx"&gt;XElement.Save(Stream)&lt;/a&gt;. No functionality gain but a convenient addition, for instance when you want to send the serialization of an XDocument or XElement to the request stream of an HttpWebRequest. There are also corresponding Load methods taking a Stream as the input, &lt;a href="http://msdn.microsoft.com/en-us/library/cc838349(VS.100).aspx"&gt;XDocument.Load(Stream)&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/library/cc838544(VS.100).aspx"&gt;XElement.Load(Stream)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is also a new &lt;a href="http://msdn.microsoft.com/en-us/library/system.xml.linq.readeroptions(VS.100).aspx"&gt;enumeration ReaderOptions&lt;/a&gt; in System.Xml.Linq but so far I have not found any method or property using that enumeration.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;XmlReaderSettings has a new property &lt;a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlreadersettings.dtdprocessing(VS.100).aspx"&gt;DtdProcessing&lt;/a&gt; that replaces the now obsolete &lt;a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlreadersettings.prohibitdtd(VS.100).aspx"&gt;ProhibitDtd&lt;/a&gt; property. With the boolean property ProhibitDtd you could choose to either allow DTD parsing/processing or to prohibit it. With the new DtdProcessing property you have now three choices, prohibit, parse, or ignore. Ignore could give you performance benefits over parse. for instance the following parses the W3C home page twice, once ignoring the DTD, once parsing/processing it:&lt;/p&gt;
&lt;pre&gt;            Stopwatch watch = &lt;span style="color:blue;"&gt;new&lt;/span&gt; Stopwatch();&lt;br /&gt;            XmlReaderSettings settings = &lt;span style="color:blue;"&gt;new&lt;/span&gt; XmlReaderSettings();&lt;br /&gt;            settings.DtdProcessing = DtdProcessing.Ignore;&lt;br /&gt;            watch.Start();&lt;br /&gt;            &lt;span style="color:blue;"&gt;using&lt;/span&gt; (XmlReader reader = XmlReader.Create(&lt;span style="color:#a31515;"&gt;@&amp;quot;http://www.w3.org/&amp;quot;&lt;/span&gt;, settings))&lt;br /&gt;            {&lt;br /&gt;                &lt;span style="color:blue;"&gt;while&lt;/span&gt; (reader.Read())&lt;br /&gt;                {&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            watch.Stop();&lt;br /&gt;            Console.WriteLine(&lt;span style="color:#a31515;"&gt;&amp;quot;DtdProcessing.Ignore: Elapsed time: {0}&amp;quot;&lt;/span&gt;, watch.Elapsed);&lt;br /&gt;&lt;br /&gt;            settings.DtdProcessing = DtdProcessing.Parse;&lt;br /&gt;            watch.Start();&lt;br /&gt;            &lt;span style="color:blue;"&gt;using&lt;/span&gt; (XmlReader reader = XmlReader.Create(&lt;span style="color:#a31515;"&gt;@&amp;quot;http://www.w3.org/&amp;quot;&lt;/span&gt;, settings))&lt;br /&gt;            {&lt;br /&gt;                &lt;span style="color:blue;"&gt;while&lt;/span&gt; (reader.Read())&lt;br /&gt;                {&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            watch.Stop();&lt;br /&gt;            Console.WriteLine(&lt;span style="color:#a31515;"&gt;&amp;quot;DtdProcessing.Parse: Elapsed time: {0}&amp;quot;&lt;/span&gt;, watch.Elapsed);&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The output for me here is&lt;/p&gt;
&lt;p&gt;DtdProcessing.Ignore: Elapsed time: 00:00:01.5245222&lt;br /&gt;DtdProcessing.Parse: Elapsed time: 00:00:09.1677892&lt;/p&gt;
&lt;p&gt;so ignoring the DTD is about nine times faster for that sample document. On the other hand if the DTD defines any entities that are then referenced in the XML document ignoring the DTD would give you an exception:&lt;/p&gt;
&lt;pre&gt;            XmlReaderSettings settings = &lt;span style="color:blue;"&gt;new&lt;/span&gt; XmlReaderSettings();&lt;br /&gt;            settings.DtdProcessing = DtdProcessing.Ignore;&lt;br /&gt;&lt;br /&gt;            &lt;span style="color:blue;"&gt;string&lt;/span&gt; xhtml = &lt;span style="color:#a31515;"&gt;@&amp;quot;&amp;lt;!DOCTYPE html &lt;br /&gt;     PUBLIC &amp;quot;&amp;quot;-//W3C//DTD XHTML 1.0 Strict//EN&amp;quot;&amp;quot;&lt;br /&gt;     &amp;quot;&amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;html xml:lang=&amp;quot;&amp;quot;en&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Example&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;Price is: 100 &amp;amp;euro;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&amp;quot;&lt;/span&gt;;&lt;br /&gt;            &lt;span style="color:blue;"&gt;using&lt;/span&gt; (XmlReader reader = XmlReader.Create(&lt;span style="color:blue;"&gt;new&lt;/span&gt; StringReader(xhtml), settings))&lt;br /&gt;            {&lt;br /&gt;                &lt;span style="color:blue;"&gt;while&lt;/span&gt; (reader.Read()) { }&lt;br /&gt;            }&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;throws the exception &amp;quot;Reference to undeclared entity &amp;#39;euro&amp;#39;&amp;quot;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;That&amp;#39;s all I have found so far, I will edit this post when I find more.&lt;/p&gt;
&lt;p&gt;[edit 2009-05-26] I have now found a page &amp;quot;&lt;a href="http://msdn.microsoft.com/en-us/library/1k76xshy(VS.100).aspx"&gt;What&amp;#39;s new in System.Xml&lt;/a&gt;&amp;quot; in the .NET framework 4 Beta 1 documentation. Oddly enough it lists LINQ to XML and the XSLT compiler as new features although both were introduced in .NET 3.5. It also mentions new methods in the &lt;a href="http://msdn.microsoft.com/en-us/library/system.xml.xmlconvert(VS.100).aspx"&gt;XmlConvert&lt;/a&gt; class.&lt;/p&gt;</description></item><item><title>Visual Studio 2010 and .NET Framework 4.0 Beta 1 Just Released</title><link>http://msmvps.com/blogs/nunogodinho/archive/2009/05/20/visual-studio-2010-and-net-framework-4-0-beta-1-just-released.aspx</link><pubDate>Wed, 20 May 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1692783</guid><dc:creator>NunoGodinho</dc:creator><description>&lt;p&gt;The &lt;a href="http://blogs.msdn.com/somasegar/archive/2009/05/18/visual-studio-2010-and-net-fx-4-beta-1-ships.aspx" target="_blank"&gt;Beta 1 release of Visual Studio 2010, .NET Framework and Visual Studio Team Foundation Server Beta 1 was release on the last 18th of May&lt;/a&gt;, just last Monday, this for MSDN Subscribers and today for Non-MSDN Subscribers, and it will bring great enhancements in several levels. You can install it Side-By-Side with your existing Visual Studio Edition and try it, but don’t forget to read the ReadMe file for both &lt;a href="http://go.microsoft.com/fwlink/?LinkId=143397" target="_blank"&gt;Visual Studio 2010&lt;/a&gt; and &lt;a href="http://go.microsoft.com/fwlink/?LinkId=143398" target="_blank"&gt;.NET Framework 4.0&lt;/a&gt; in order to know what to expect. I still think that is better to test this version on a Virtual Machine, but you can choose what to do.&lt;/p&gt;  &lt;p&gt;A quick look at some of the Enhancements:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;.NET Framework 4.0&lt;/strong&gt;       &lt;ul&gt;       &lt;li&gt;Main Technologies          &lt;ul&gt;           &lt;li&gt;WPF 4.0 &lt;/li&gt;            &lt;li&gt;WCF 4.0 &lt;/li&gt;            &lt;li&gt;WF 4.0 &lt;/li&gt;            &lt;li&gt;ASP.NET 4.0 &lt;/li&gt;            &lt;li&gt;ASP.NET AJAX 4.0 &lt;/li&gt;            &lt;li&gt;Entity Framework 2.0 &lt;/li&gt;            &lt;li&gt;Data Services 2.0 &lt;/li&gt;            &lt;li&gt;Project &amp;quot;Velocity&amp;quot; &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;Managed Languages          &lt;ul&gt;           &lt;li&gt;VB              &lt;ul&gt;               &lt;li&gt;Implicit Line Continuation &lt;/li&gt;                &lt;li&gt;Multi-line Lambdas &lt;/li&gt;                &lt;li&gt;Statement Lambdas &lt;/li&gt;                &lt;li&gt;Auto Properties &lt;/li&gt;             &lt;/ul&gt;           &lt;/li&gt;            &lt;li&gt;C#              &lt;ul&gt;               &lt;li&gt;Named Parameters &lt;/li&gt;                &lt;li&gt;Optional Parameters &lt;/li&gt;             &lt;/ul&gt;           &lt;/li&gt;            &lt;li&gt;F# &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;Other Elements          &lt;ul&gt;           &lt;li&gt;Parallel Linq &lt;/li&gt;            &lt;li&gt;Managed Extensibility Framework &lt;/li&gt;            &lt;li&gt;DLR Built-In &lt;/li&gt;            &lt;li&gt;No need for PIAs – New way to Interoperate &lt;/li&gt;            &lt;li&gt;Generic Covarience &lt;/li&gt;            &lt;li&gt;Generic Contravariance &lt;/li&gt;            &lt;li&gt;CLR running In-Proc Side-by-Side &lt;/li&gt;            &lt;li&gt;Code Contracts &lt;/li&gt;            &lt;li&gt;Background GC &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Visual Studio 2010&lt;/strong&gt;       &lt;ul&gt;       &lt;li&gt;WPF-Based Editor &lt;/li&gt;        &lt;li&gt;New Look &amp;amp; Feel &lt;/li&gt;        &lt;li&gt;Improved WPF Tooling &lt;/li&gt;        &lt;li&gt;MVC Tooling &lt;/li&gt;        &lt;li&gt;Dynamic Data Tooling &lt;/li&gt;        &lt;li&gt;Sharepoint Tooling &lt;/li&gt;        &lt;li&gt;Click-Once Enhancements for Office &lt;/li&gt;        &lt;li&gt;Html Snippets &lt;/li&gt;        &lt;li&gt;Web Deploy &lt;/li&gt;        &lt;li&gt;Breakpoint Grouping &lt;/li&gt;        &lt;li&gt;Parallel Tasks Window &lt;/li&gt;        &lt;li&gt;Highlight References &lt;/li&gt;        &lt;li&gt;Call Hierarchy &lt;/li&gt;        &lt;li&gt;Historical Debugging &lt;/li&gt;        &lt;li&gt;Inline Call Tree &lt;/li&gt;        &lt;li&gt;Quick Search &lt;/li&gt;        &lt;li&gt;JQuery Intellisense &lt;/li&gt;        &lt;li&gt;Concurrency Profiler &lt;/li&gt;        &lt;li&gt;Breakpoint Import/Export &lt;/li&gt;        &lt;li&gt;Document Map Margin &lt;/li&gt;        &lt;li&gt;Parallel Stacks Window &lt;/li&gt;        &lt;li&gt;Improved Multi-Monitor &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Be in touch for more information regarding this release and other releases and don’t forget to see &lt;a href="http://channel9.msdn.com" target="_blank"&gt;Channel 9&lt;/a&gt; and the related &lt;a href="http://channel9.msdn.com/tags/vs2010/" target="_blank"&gt;Visual Studio 2010 Videos&lt;/a&gt; and also &lt;a href="http://channel9.msdn.com/tags/.NET+Framework+4.0/" target="_blank"&gt;.NET Framework 4.0&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Also check the &lt;a href="http://www.microsoft.com/downloads/details.aspx?DisplayLang=en&amp;amp;FamilyID=752cb725-969b-4732-a383-ed5740f02e93" target="_blank"&gt;Visual Studio 2010 Training Kit May Preview 2009&lt;/a&gt; that is also available for download.&lt;/p&gt;</description></item><item><title>More 10-4</title><link>http://msmvps.com/blogs/keith/archive/2009/05/04/more-10-4.aspx</link><pubDate>Mon, 04 May 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1691841</guid><dc:creator>keith</dc:creator><description>&lt;p&gt;&lt;a href="http://channel9.msdn.com/shows/10-4/10-4-Episode-2-Welcome-to-Visual-Studio-2010/"&gt;Episode 2&lt;/a&gt; of &amp;ldquo;&lt;a href="http://channel9.msdn.com/Shows/10-4/"&gt;10-4&lt;/a&gt;&amp;rdquo; (Dec 24th &amp;ndash; &lt;a href="http://channel9.msdn.com/Niners/JasonOlson/"&gt;Jason Olson&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Key feature shown &amp;ndash; The customized start page.&amp;nbsp; I like the carry over from office of pining down a document.&amp;nbsp; In this case the pining of a project.&amp;nbsp; I know this sounds small, but how many times have you been working on your core project, to interupt it with some proof of concept projects?&amp;nbsp; I find that I then have to either expand the number of projects in my file menu or navigate to the project files again.&amp;nbsp; This will allow me to keep my official work always at the top.&lt;/p&gt;
&lt;p&gt;Jason then demonstrated the extensibility of the Start Page.&amp;nbsp; There are some options here like the folder lists and changing the background, etc.&amp;nbsp; However, in my training, I have found very few people who took advantage of any Start Page customization in the last two versions of VS.&lt;/p&gt;
&lt;p&gt;I tried out the customizations myself through the walkthroughs that Brian Keller talked about in &lt;a href="http://channel9.msdn.com/shows/10-4/10-4-Episode-1-Working-with-the-Visual-Studio-2010-CTP-VPC/"&gt;Episode 1&lt;/a&gt; (see &lt;a href="http://msmvps.com/blogs/keith/archive/2009/05/01/that-s-a-big-10-4-little-buddy.aspx"&gt;prior post&lt;/a&gt;).&amp;nbsp; While Jason showed us how to make changes by using notepad, I loaded up the csproj file into Visual Studio and used the WPF designer.&amp;nbsp; The first load of the xaml looked very odd.&amp;nbsp; After closing the xaml and reopening, it looked great.&lt;/p&gt;
&lt;p&gt;Rather than deleting or commenting the code for the button referenced in the walkthrough, the Walkthrough button&amp;rsquo;s visibility was set to &amp;ldquo;Hidden&amp;rdquo; in the properties window.&lt;/p&gt;
&lt;p&gt;In order to add a new item to the TrayGroup, I clicked on the group and expanded the Items property.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_0FFC4A7C.png"&gt;&lt;img height="183" width="244" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_thumb_5F00_602BEB7E.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt; &lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_501FAD78.png"&gt;&lt;img height="244" width="180" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_thumb_5F00_55C2EF3E.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;I was surprised to see that I could not &amp;ldquo;Add&amp;rdquo; a new TrayGroupItem through the dialog box.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_36310EB8.png"&gt;&lt;img height="134" width="244" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_thumb_5F00_696FD8D2.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Therefore I used the XAML tab under the designer to add the new item manually.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_7E98BD18.png"&gt;&lt;img height="141" width="192" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_thumb_5F00_161892AC.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Moving to the next part of adding content, be sure in step 5 to read the note.&amp;nbsp; I love in training when an attendee asks a question about a bug in their lab work.&amp;nbsp; I ask them to read the next sentence which asks them to observe the bug which was just created. The standard response is &amp;ldquo;Ooohh.&amp;rdquo;&amp;nbsp; Additionally, I created a new TabGroup to host any RSS Feeds I might want to track.&amp;nbsp; I inserted the following code&amp;nbsp; at the end after the &amp;ldquo;Visual Studio&amp;rdquo; TrayItem.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- RSS Feeds --&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;vs:TrayItem Header=&amp;quot;RSS Feeds&amp;quot; x:Uid=&amp;quot;RSS_Header&amp;quot;&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;vs:TrayGroup&amp;gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;vs:TrayGroupItem Content=&amp;quot;Soma&amp;#39;s blog&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ImageSource=&amp;quot;c:\Users\Public\Documents\CTPWalkthroughs\Visual Studio\Samples\Start Page\soma.png&amp;quot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InnerContentUri=&amp;quot;SomaBlog;Component/UserControl1.xaml&amp;quot; /&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/vs:TrayGroup&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/vs:TrayItem&amp;gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/vs:Tray&amp;gt; &lt;br /&gt;&amp;lt;/Grid&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here were my results:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_21CB492D.png"&gt;&lt;img height="121" width="244" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_thumb_5F00_7761A8C0.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt; &lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_293EE0BA.png"&gt;&lt;img height="202" width="244" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_thumb_5F00_34F1973B.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It looks pretty good except for one part.&amp;nbsp; Visibility with WPF does not mean to ignore the element and have other elements slide into its place.&amp;nbsp; By changing the property to &amp;ldquo;Collapsed&amp;rdquo; the image disappears and there is no need for the scroll bar to be used this time.&amp;nbsp; Feedback looks better when it is not cut off.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_765471B4.png"&gt;&lt;img height="99" width="244" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/keith/image_5F00_thumb_5F00_1FB0DB15.png" alt="image" border="0" title="image" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Overall, this was a pretty easy approach at adding items, using code to extend the IDE, and now for me to add several other blogs to my environment.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://channel9.msdn.com/shows/10-4/10-4-Episode-3-ASPNET-WebForms-40/"&gt;Episode 3&lt;/a&gt; of &amp;ldquo;&lt;a href="http://channel9.msdn.com/Shows/10-4/"&gt;10-4&lt;/a&gt;&amp;rdquo; (Dec 31st &amp;ndash; &lt;a href="http://channel9.msdn.com/Niners/JonathanCarter/"&gt;Jonathan Carter&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Two items out of this episode I liked hearing.&amp;nbsp; Jonathan firmly states that WebForms is still a major player in VS.&amp;nbsp; This version adds a lot of strength and new features to the model we have been using for the last six years.&amp;nbsp; Why would this be questioned?&amp;nbsp; Well VMC seems to be a fan favorite right now and there is a very vocal camp that assumes this is the only way to create content now.&amp;nbsp; I&amp;rsquo;m not an extremist myself, so I like to know how a proven tech is improved.&lt;/p&gt;
&lt;p&gt;The second item proves my closing sentence in the prior paragraph: ClientID!&amp;nbsp; Working with dynamically created items through code has been a hassle for me since the framework 1.1.&amp;nbsp; I spent a lot of time in 2003-2004 writing code with Regular Expressions to help me navigate through shopping carts and such.&amp;nbsp; Microsoft has provided some really great approaches to this.&amp;nbsp; I&amp;rsquo;m very hopeful for this feature in making your lives easier.&amp;nbsp; Be sure to watch this one.&lt;/p&gt;</description></item></channel></rss>