<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>BCL Team Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/bclteam/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/bclteam/feed.xml</link>
    <description>Base types, Collections, Diagnostics, IO, RegEx...</description>
    <lastBuildDate>Thu, 23 Jul 2015 04:23:28 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Our Blog has Moved</title>
      <link>https://docs.microsoft.com/archive/blogs/bclteam/our-blog-has-moved</link>
      <pubDate>Thu, 20 Jun 2013 18:16:00 GMT</pubDate>
      <dc:creator><![CDATA[Immo Landwerth [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bclteam/2013/06/20/our-blog-has-moved/</guid>
      <description><![CDATA[As you may have noticed, we&rsquo;ve started to blog most of our announcements on the .NET blog. As...]]></description>
      <content:encoded><![CDATA[As you may have noticed, we&rsquo;ve started to blog most of our announcements on the <a href="https://blogs.msdn.com/b/dotnet">.NET blog</a>. As of today, we are officially merging the BCL blog with the .NET blog.

Originally, the .NET blog was the CLR&rsquo;s team blog. Back in those days, we&rsquo;ve basically split the content according to feature area: runtime features go to the CLR blog, managed features go to the BCL blog. After a few years we&rsquo;ve figured out that this split doesn&rsquo;t really help.

First of all many features span several layers so trying to split is often quite arbitrary.

Secondly, it didn&rsquo;t give us a good venue to talk about .NET as a product. Thus, we&rsquo;ve decided to rename the CLR Team blog into the .NET blog. Since then, we haven&rsquo;t stopped talking about runtime features, for example we blogged about <a href="https://blogs.msdn.com/b/dotnet/archive/2012/07/20/the-net-framework-4-5-includes-new-garbage-collector-enhancements-for-client-and-server-apps.aspx">garbage collector</a> improvements. We also blogged about features that could be considered runtime or class library features, for example the <a href="https://blogs.msdn.com/b/dotnet/archive/2012/08/28/evolving-the-reflection-api.aspx">new reflection APIs</a> or the <a href="https://blogs.msdn.com/b/dotnet/archive/2012/04/17/net-for-metro-style-apps.aspx">new profile for Windows Store apps</a>.

More importantly though: we&rsquo;ve started to blog about broader areas as well, for example <a href="https://blogs.msdn.com/b/dotnet/archive/2012/03/07/optimizing-the-net-framework-deployment-experience-for-users-and-developers.aspx">how the deployment is optimized for users and developers</a>, what <a href="https://blogs.msdn.com/b/dotnet/archive/2011/09/26/compatibility-of-net-framework-4-5.aspx">work we do for compatibility</a> and even the fact that <a href="https://blogs.msdn.com/b/dotnet/archive/2013/01/03/c-is-the-language-of-the-year.aspx">C# was considered the language of the year</a>.

However, this will not change the tone nor the content we provide. We&rsquo;ll continue to talk about interesting design points, for example <a href="https://blogs.msdn.com/b/bclteam/archive/2012/12/18/preview-of-immutable-collections-released-on-nuget.aspx">immutable collections</a>.

<h1>Summary</h1>

In case you haven&rsquo;t please subscribe to the <a href="https://blogs.msdn.com/b/dotnet">.NET Blog</a>. This is where we will publish our blog posts moving forward. However, for reference purposes and in order not to break any links, we&rsquo;ll not delete this blog.

<p>See you there!</p>]]></content:encoded>
    </item>
    <item>
      <title>Update to HttpClient and Automatic Decompression</title>
      <link>https://docs.microsoft.com/archive/blogs/bclteam/update-to-httpclient-and-automatic-decompression</link>
      <pubDate>Wed, 19 Jun 2013 18:03:00 GMT</pubDate>
      <dc:creator><![CDATA[Immo Landwerth [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bclteam/2013/06/19/update-to-httpclient-and-automatic-decompression/</guid>
      <description><![CDATA[Two weeks ago, we published a beta of HttpClient that provides support for automatic decompression....]]></description>
      <content:encoded><![CDATA[<p style="padding-left: 30px;"><em>Two weeks ago, we <a href="https://blogs.msdn.com/b/dotnet/archive/2013/06/06/portable-compression-and-httpclient-working-together.aspx">published</a> a beta of <a href="https://nuget.org/packages/Microsoft.Net.Http">HttpClient</a> that provides support for automatic decompression. Since then, we&rsquo;ve received a fair amount of feedback, especially around the fact that it relies on a native implementation of compression that isn&rsquo;t available on the same platforms as HttpClient.</em><p style="padding-left: 30px;"><em>Today, we&rsquo;ve published another beta of HttpClient that will address those concerns.</em></p>

Want to read more? We've posted <a href="https://blogs.msdn.com/b/dotnet/archive/2013/06/19/update-to-httpclient-and-automatic-decompression.aspx">the announcement</a> to our .NET Blog.</p>]]></content:encoded>
    </item>
    <item>
      <title>Portable Compression and HttpClient Working Together</title>
      <link>https://docs.microsoft.com/archive/blogs/bclteam/portable-compression-and-httpclient-working-together</link>
      <pubDate>Fri, 07 Jun 2013 23:01:00 GMT</pubDate>
      <dc:creator><![CDATA[Immo Landwerth [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bclteam/2013/06/07/portable-compression-and-httpclient-working-together/</guid>
      <description><![CDATA[Today we&rsquo;re happy to announce that we released two NuGet packages:    A brand new...]]></description>
      <content:encoded><![CDATA[<p style="padding-left: 30px;"><em>Today we&rsquo;re happy to announce that we released two NuGet packages:</em><ul style="padding-left: 30px;">  <ul>  <li><em><strong>A brand new <a href="https://nuget.org/packages/Microsoft.Bcl.Compression">Microsoft.Bcl.Compression</a> (Beta)</strong>. A portable compression library that supports stream based compression (gzip, deflate) as well as ZIP archives.</em></li>  <li><em><strong>An updated <a href="https://nuget.org/packages/Microsoft.Net.Http">Microsoft.Net.Http</a> 2.2 (Beta)</strong>. <a href="https://blogs.msdn.com/b/dotnet/archive/2013/05/29/get-httpclient-rtm-200-ok.aspx">Last week we shipped an RTM version</a>. Today, we released a new beta that provides automatic decompression by taking a dependency on the Microsoft.Bcl.Compression package.</em></li>  </ul>  </ul><p style="padding-left: 30px;"><em>Before we go into the details, let&rsquo;s first take a look at why compression is particularly interesting for <strong>HttpClient</strong>.</em></p>

Want to read more? We've posted <a href="https://blogs.msdn.com/b/dotnet/archive/2013/06/06/portable-compression-and-httpclient-working-together.aspx">the announcement</a> to our .NET Blog.</p>]]></content:encoded>
    </item>
    <item>
      <title>Portable HttpClient is now available as RTM</title>
      <link>https://docs.microsoft.com/archive/blogs/bclteam/portable-httpclient-is-now-available-as-rtm</link>
      <pubDate>Wed, 29 May 2013 19:18:00 GMT</pubDate>
      <dc:creator><![CDATA[Immo Landwerth [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bclteam/2013/05/29/portable-httpclient-is-now-available-as-rtm/</guid>
      <description><![CDATA[As promised in our last blog post we&rsquo;re releasing Microsoft.Net.Http as a stable NuGet package...]]></description>
      <content:encoded><![CDATA[<p style="padding-left: 30px;"><em>As promised in our <a href="https://blogs.msdn.com/b/dotnet/archive/2013/05/22/portable-httpclient-is-now-available-as-rc.aspx">last blog post</a> we&rsquo;re releasing <a href="https://nuget.org/packages/Microsoft.Net.Http">Microsoft.Net.Http</a> as a stable NuGet package today. Yep, that&rsquo;s right: You can finally start using the portable HttpClient 2.1 in production!</em>Want to read more? We've posted our <a href="https://blogs.msdn.com/b/dotnet/archive/2013/05/29/get-httpclient-rtm-200-ok.aspx">announcement to the .NET Blog</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Portable HttpClient is now available as RC</title>
      <link>https://docs.microsoft.com/archive/blogs/bclteam/portable-httpclient-is-now-available-as-rc</link>
      <pubDate>Thu, 23 May 2013 13:51:00 GMT</pubDate>
      <dc:creator><![CDATA[Immo Landwerth [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bclteam/2013/05/23/portable-httpclient-is-now-available-as-rc/</guid>
      <description><![CDATA[Three months ago we shipped the first preview of the portable HttpClient. Many of you wondered when...]]></description>
      <content:encoded><![CDATA[<p style="padding-left: 30px;"><em>Three months ago <a href="https://blogs.msdn.com/b/bclteam/archive/2013/02/18/portable-httpclient-for-net-framework-and-windows-phone.aspx">we shipped the first preview of the portable HttpClient</a>. Many of you wondered when we would ship the RTM version. Today, we&rsquo;re happy to announce the first step towards an RTM: We shipped a release candidate (RC) of HttpClient (<a href="https://nuget.org/packages/Microsoft.Net.Http/">Microsoft.Net.Http package on NuGet</a>) that includes all the bug fixes since the preview.</em>Want to read more? We've posted <a href="https://blogs.msdn.com/b/dotnet/archive/2013/05/22/portable-httpclient-is-now-available-as-rc.aspx">our announcement</a> to the .NET Blog.</p>]]></content:encoded>
    </item>
    <item>
      <title>Social Engineering</title>
      <link>https://docs.microsoft.com/archive/blogs/bclteam/social-engineering</link>
      <pubDate>Wed, 24 Apr 2013 11:38:00 GMT</pubDate>
      <dc:creator><![CDATA[Immo Landwerth [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bclteam/2013/04/24/social-engineering/</guid>
      <description><![CDATA[Are you wondering what my team does for team building?You can find out on our .NET wide blog.]]></description>
      <content:encoded><![CDATA[Are you wondering what my team does for team building?<p>You can find out on our <a href="https://blogs.msdn.com/b/dotnet/archive/2013/04/24/social-engineering.aspx">.NET wide blog</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Microsoft.Bcl.Async is Now Stable</title>
      <link>https://docs.microsoft.com/archive/blogs/bclteam/microsoft-bcl-async-is-now-stable</link>
      <pubDate>Wed, 17 Apr 2013 17:09:00 GMT</pubDate>
      <dc:creator><![CDATA[Immo Landwerth [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bclteam/2013/04/17/microsoft-bcl-async-is-now-stable/</guid>
      <description><![CDATA[It&rsquo;s done. About five months ago, we shipped our Microsoft.Bcl.Async NuGet package which...]]></description>
      <content:encoded><![CDATA[<p>It&rsquo;s done. About five months ago, <a href="https://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx">we shipped</a> our <a href="https://nuget.org/packages/Microsoft.Bcl.Async">Microsoft.Bcl.Async</a> NuGet package which provides support for the async/await keywords for pre-.NET 4.5 platforms, such as .NET 4, Silverlight 4, and Windows Phone 7.5. Of course, this includes support for portable class libraries as well.</p>
<p>We believe we&rsquo;ve baked <a href="https://nuget.org/packages/Microsoft.Bcl.Async">Microsoft.Bcl.Async</a> enough to flip the switch and mark it as stable. This might not sound like a big deal but it is the NuGet equivalent of shipping an RTM.</p>
<p><br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/2642.AsyncStable1.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/2642.AsyncStable1.jpg"><img style="margin-right: auto; margin-left: auto; display: block;" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/2642.AsyncStable1.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/2642.AsyncStable1.jpg" alt="" border="0" /></a></p>
<p style="text-align: right;"><strong><em>C-3PO</em></strong><em>: "Sir, it's quite possible this package is not entirely stable." </em></p>
<p style="text-align: right;"><strong><em>Han Solo</em></strong><em>: "Not entirely stable? Well, I'm glad you're here to tell us</em></p>
<p style="text-align: right;"><em>these things. Chewie, take the professor </em><em>in the back and</em></p>
<p style="text-align: right;"><em>show him </em><em>how to upgrade the NuGet package!" </em></p>
<p style="text-align: right;"><strong><em>--- Star Wars as Immo remembers it </em></strong></p>
<h1>What&rsquo;s the big deal with being stable?</h1>
<p>Being stable means the owner of that package states that API and functionality are unlikely to change and therefore suitable for use in production. This also enables 3rd parties to publish stable NuGet packages that depend on our package because NuGet prevents stable packages from depending on pre-release packages.</p>
<h1>What about Microsoft.CompilerServices.AsyncTargetingPack?</h1>
<p>Before we shipped Microsoft.Bcl.Async we shipped another NuGet package which was provided by the language team to gather feedback on the async and await keywords (&ldquo;Async Targeting Pack&rdquo;)</p>
<p><a href="https://www.nuget.org/packages/Microsoft.CompilerServices.AsyncTargetingPack">https://www.nuget.org/packages/Microsoft.CompilerServices.AsyncTargetingPack</a></p>
<p>Our stable release of Microsoft.Bcl.Async officially supersedes the Async Targeting Pack. We haven&rsquo;t removed it, but we unlisted it on NuGet so that new developers aren&rsquo;t accidentally using the old version. We&rsquo;ve also added a readme.txt which is automatically displayed by VS when existing consumers upgrade their package references.</p>
<h1>Fixed Issues</h1>
<p>The majority of customer issues we&rsquo;ve seen was due to two issues:</p>
<ol>
<li><strong>Outdated version of NuGet</strong>. In order to use the Async package from a portable class library, you need to run the <a href="https://docs.nuget.org/docs/release-notes/nuget-2.1#Support_for_Portable_Libraries">NuGet 2.1 or higher</a>. To address this in the future, <a href="https://nuget.codeplex.com/workitem/2922">we have worked with the NuGet team</a> and <a href="https://nuget.codeplex.com/">NuGet 2.3 will add this ability</a>. For now, you will need to know to install an updated version of NuGet (see instructions in section &ldquo;How to Upgrade&rdquo; below).</li>
<li><strong>Missing reference to the async package from all referencing projects</strong>. In order to make the async functionality work across all platforms, we make use of a CLR feature called assembly unification. For that to work properly, all projects must have a reference to the Async NuGet package. Since this can be easy to forget, we&rsquo;ve added a warning mechanism to our package that tells you what to do. I&rsquo;ll discuss this in more detail below.</li>
</ol>
<p>After upgrading, you will see the following build warning:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/4426.AsyncStable2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/4426.AsyncStable2.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/4426.AsyncStable2.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/4426.AsyncStable2.png" alt="" border="0" /></a>&nbsp;</p>
<p>After fixing this, you might see the following warnings:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/0525.AsyncStable3.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/0525.AsyncStable3.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/0525.AsyncStable3.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/0525.AsyncStable3.png" alt="" border="0" /></a></p>
<p>In both cases, the project that causes the warning is missing a NuGet package reference. Adding these references will fix the warnings.</p>
<p><em>Tip: If your solution contains many projects, you may want bulk-add the async packages to several projects at once. You can do this by right clicking your solution and selecting <strong>Manage NuGet Packages for Solution</strong>. Select the NuGet package and click <strong>Manage</strong>. A dialog appears that enables you to select the projects you want to update. </em></p>
<p>Add references for <strong>Microsoft.Bcl</strong>, <strong>Microsoft.Bcl.Async</strong>, and <strong>Microsoft.Bcl.Build</strong> to all projects that show the warnings mentioned previously.</p>
<h1>Branding</h1>
<p>We&rsquo;ve added some branding to make our packages easier to recognize. Our <a href="https://www.nuget.org/profiles/dotnetframework/">dotnetframework</a> user now displays the .NET gravatar.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/5543.AsyncStable4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/5543.AsyncStable4.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/5543.AsyncStable4.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/5543.AsyncStable4.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>and so does our async NuGet package:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/5482.4174_AsyncStable5_png-550x0.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/5482.4174_5F00_AsyncStable5_5F00_png_2D00_550x0.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/5482.4174_AsyncStable5_png-550x0.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/370x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/5482.4174_5F00_AsyncStable5_5F00_png_2D00_550x0.png" alt="" border="0" /></a>&nbsp;</p>
<h1>How to Upgrade</h1>
<p><em><span style="background-color: #ffff99;"><strong>Important</strong>: Since our package contains portable class libraries, you need to use <a title="NuGet 2.1 or higher" href="https://docs.nuget.org/docs/release-notes/nuget-2.1#Support_for_Portable_Libraries"><span style="background-color: #ffff99;">NuGet 2.1 or higher</span></a></span>. You can check whether you have the latest version by going to <strong>Tools | Extensions and Updates</strong>. When the Extensions and Updates dialog opens, select <strong>Updates | Visual Studio Gallery</strong> and look for an entry titled <strong>NuGet Package Manager</strong>. </em></p>
<p>In order to upgrade to the RTM version, right click your project and select <strong>Manage NuGet Packages</strong>. In the resulting dialog, select the <strong>Updates</strong> section on the left hand side. In the center, the Async NuGet package should show up. Simply click the <strong>Update</strong> button.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/7245.AsyncStable6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/7245.AsyncStable6.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/7245.AsyncStable6.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/7245.AsyncStable6.png" alt="" border="0" /></a></p>
<h1>Summary</h1>
<p><a href="https://nuget.org/packages/Microsoft.Bcl.Async">Microsoft.Bcl.Async</a> is now stable which means you can use it in production. Of course, software is never truly done, so we still want to hear from you if things don&rsquo;t work for you. You can contact us via comments under this blog posts or via our <a href="https://www.nuget.org/packages/Microsoft.Bcl.Async/ContactOwners">NuGet contact page</a>. Also, make sure to check out the <a href="https://blogs.msdn.com/b/bclteam/p/asynctargetingpackkb.aspx">known issues list</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Inner Workings of Immutable Collections on Channel 9</title>
      <link>https://docs.microsoft.com/archive/blogs/bclteam/inner-workings-of-immutable-collections-on-channel-9</link>
      <pubDate>Tue, 19 Mar 2013 11:20:00 GMT</pubDate>
      <dc:creator><![CDATA[Immo Landwerth [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bclteam/2013/03/19/inner-workings-of-immutable-collections-on-channel-9/</guid>
      <description><![CDATA[After introducing immutable collections three months ago, it&rsquo;s now time to peek behind the...]]></description>
      <content:encoded><![CDATA[After <a href="https://blogs.msdn.com/b/bclteam/archive/2012/12/18/preview-of-immutable-collections-released-on-nuget.aspx">introducing immutable collections</a> three months ago, it&rsquo;s now time to peek behind the curtain. What did we learn from the preview? How do they work? What trade-offs did we make? Are they different from <a href="https://en.wikipedia.org/wiki/Persistent_data_structure">persistent data structures</a>?

Those are the kind of questions we&rsquo;ll cover in the <a title="second episode on Channel 9" href="https://channel9.msdn.com/Shows/Going+Deep/Immo-Landwerth-and-Andrew-Arnott-Inside-Immutable-Collections">second episode on Channel 9</a> about immutable collections (make sure you haven&rsquo;t missed the <a href="https://blogs.msdn.com/b/bclteam/archive/2013/01/16/immutable-collections-is-on-channel-9.aspx">first one</a>).

Tune in and enjoy!

<p><iframe style="height: 288px; width: 512px;" src="https://channel9.msdn.com/Shows/Going+Deep/Immo-Landwerth-and-Andrew-Arnott-Inside-Immutable-Collections/player?w=512&amp;h=288" frameborder="0" scrolling="no"></iframe></p>]]></content:encoded>
    </item>
    <item>
      <title>Update to Immutable Collections</title>
      <link>https://docs.microsoft.com/archive/blogs/bclteam/update-to-immutable-collections</link>
      <pubDate>Wed, 06 Mar 2013 08:17:00 GMT</pubDate>
      <dc:creator><![CDATA[Immo Landwerth [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bclteam/2013/03/06/update-to-immutable-collections/</guid>
      <description><![CDATA[Thanks a lot for your great feedback!
Two months ago, we shipped a NuGet package with support for...]]></description>
      <content:encoded><![CDATA[<p>Thanks a lot for your great feedback!</p>
<p>Two months ago, we shipped a NuGet package with support for <a href="https://blogs.msdn.com/b/bclteam/archive/2012/12/18/preview-of-immutable-collections-released-on-nuget.aspx">immutable collections</a>. We&rsquo;ve also talked about it on <a href="https://blogs.msdn.com/b/bclteam/archive/2013/01/16/immutable-collections-is-on-channel-9.aspx">Channel 9</a>. Since then we received feedback through various channels and we&rsquo;re happy to announce <a href="https://nuget.org/packages/Microsoft.Bcl.Immutable">we shipped an update</a> on NuGet that addresses your feedback.</p>
<h1>Feedback Channels</h1>
<p>First of all: how are we tracking your feedback? We track social media, such as Twitter, Reddit and our <a href="https://www.facebook.com/Dotnet">official Facebook page</a>. We also track <a href="https://www.stackoverflow.com">StackOverflow</a>, <a href="https://connect.microsoft.com">Connect</a>, the comments on this blog, and last but not least emails send through the NuGet&rsquo;s <a href="https://nuget.org/packages/Microsoft.Bcl.Immutable/ContactOwners">Contact Owners</a> mechanism. Yes, we really want your feedback!</p>
<p>The most direct way to contact us is via NuGet or comments on this blog.</p>
<h1>Your Feedback</h1>
<h2>Package Installation Issues</h2>
<p>Some customers reported issues with installing the NuGet package. In all cases, the root cause was an outdated version of the NuGet package manager. Immutable collections use portable class libraries and they are only <a href="https://docs.nuget.org/docs/release-notes/nuget-2.1#Support_for_Portable_Libraries">supported by NuGet 2.1 or higher</a>.</p>
<p>In order to update the immutable collections package, please install the latest version of NuGet. You can check whether you have the latest version by going to <strong>Tools | Extensions and Updates</strong>. When the Extensions and Updates dialog opens, select <strong>Updates | Visual Studio Gallery</strong> and look for an entry titled <strong>NuGet Package Manager</strong>.</p>
<p>Unfortunately, there is currently no way for a package to specify a minimum required version of NuGet. To address this in the future, <a href="https://nuget.codeplex.com/workitem/2922">we have worked with the NuGet team</a> and <a href="https://nuget.codeplex.com/">NuGet 2.3 will add this ability</a>. For now, you will need to know to install an updated version of NuGet.</p>
<h2>Construction</h2>
<p>We explicitly decided not to provide constructors for immutable collections. The reason for this is that immutable collections typically start with an empty instance. Since all empty instances would be the same, this would result in a lot of wasted objects. Instead, we decided to use a singleton as the empty instance.</p>
<p>Unfortunately this decision resulted in quite verbose code:</p>
<pre>    var list = ImmutableList&lt;int&gt;.Empty.Add(1, 2, 3);
</pre>
<p>Furthermore, this approach doesn&rsquo;t support type inference as the generic arguments must be specified. Besides having to type more this also means that anonymous types aren&rsquo;t supported (remember: only <a href="https://meta.stackoverflow.com/questions/9134/jon-skeet-facts">Jon Skeet knows their names</a>).</p>
<p>We&rsquo;ve fixed this by using a solution similar to what we use for Tuple. We&rsquo;ve created non-generic types that serve as a factory for creating immutable collections. Also, we&rsquo;ve removed the <strong>Empty</strong> property and replaced it by a factory method (it still returns a singleton but this makes the design more consistent).</p>
<p>This allows you to write code like this:</p>
<pre>    var anEmptyList = ImmutableList.Create&lt;int&gt;();
    var oneTwoThree = ImmutableList.Create&lt;int&gt;(1, 2, 3);
</pre>
<p>which can be shortened as it allows for type inference:</p>
<pre>    var oneTwoThree = ImmutableList.Create(1, 2, 3);
</pre>
<p>which in turn enables anonymous types:</p>
<pre>    var andrew = new { FirstName = &ldquo;Andrew&rdquo;, LastName = &ldquo;Arnott&rdquo; };
    var matt = new { FirstName = &ldquo;Matt&rdquo;, LastName = &ldquo;Cohn&rdquo; };
    var immo = new { FirstName = &ldquo;Immo&rdquo;, LastName = &ldquo;Landwerth&rdquo; };
    var list = ImmutableList.Create(andrew, matt, immo);
</pre>
<h2>Interoperating with existing collections</h2>
<p>As you are probably aware, the existing mutable collection interfaces in the BCL support the notion of read-only-ness. In our original design we made the decision that immutable collections shouldn&rsquo;t implement the standard mutable interfaces. The idea was that you had to explicitly call a method on them to convert them to the standard collection interfaces, such as <span style="font-family: Consolas;">ImmutableList&lt;T&gt;.ToReadOnlyCollection()</span>.</p>
<p>However, we received the feedback that people had a hard time figuring out how to pass an immutable list to en existing method that took, for example, IList&lt;T&gt;.</p>
<p>Also, we came to the conclusion that this design was inconsistent with our existing collection types. For example, List&lt;T&gt; implements IReadOnlyList&lt;T&gt; which means you can <em>view</em> a mutable list as if it were a collection that doesn&rsquo;t support modifications. In the same way it makes sense to <em>view</em> an immutable list as list that doesn&rsquo;t support modifications and thus implements IList&lt;T&gt; but returns true for <a href="https://msdn.microsoft.com/en-us/library/0cfatk9t.aspx">IsReadOnly</a>.</p>
<p>In the end, we decided to remove the method to explicitly convert the collections to read-only collections and simply implemented the existing collection interfaces in a read-only fashion.</p>
<p>The following table summarizes the relationship between the immutable collections and the existing interfaces:</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/4503.Immutable_Table.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/4503.Immutable_5F00_Table.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/4503.Immutable_Table.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/4503.Immutable_5F00_Table.png" alt="" border="0" /></a></p>
<h2>Equality semantics</h2>
<p>Today, all collections in the BCL have reference equality semantics and don&rsquo;t overload the equals operator (== in C#, = in Visual Basic).</p>
<p>In the preview release we chose to override the Object.Equals method to provide value equality, but did not overload the equals operator in line with the other collections. After reviewing this design more carefully we concluded that we don&rsquo;t want to override the Equals method.</p>
<p>Value equality on collections can be fairly expensive to compute and comparing for equality on nested collections, such as ImmutableDictionary&lt;string, ImmutableList&lt;string&gt;&gt; is more difficult to define. Finally, providing this functionality leads to more issues when different comparers are involved, as customers have <a href="https://stackoverflow.com/questions/14754194/">pointed out</a>.</p>
<p>In many cases, we believe that reference equality is sufficient. In other cases, the app should provide its own equality policy. As a result, we have removed the overrides of the Equals methods.</p>
<h2>Naming</h2>
<p>Several people pointed out that the design of our immutable collections is known as <a href="https://en.wikipedia.org/wiki/Persistent_data_structure">persistent data structures</a>. Thus, it was suggested to rename our data types accordingly, for example, PersistentList&lt;T&gt;. We&rsquo;ve given it a lot of thought and decided to keep the name &ldquo;immutable&rdquo;.</p>
<p>We want to keep the concept count low. The BCL already provides mutable collections, read-only collections, and now immutable collections. Traditionally, we don&rsquo;t introduce new concepts unless deemed necessary.</p>
<p>From a high-level perspective, the important characteristic you get from immutable collections is that they guarantee that their contents will never ever change. The fact that these collections also enable you to efficiently create new versions of an existing instance without naively copying all their contents is of secondary importance. We feel the &ldquo;Immutable&rdquo; name focuses on the most important aspect.</p>
<p>In addition, we&rsquo;ll consider adding an ImmutableArray&lt;T&gt;. This would be a struct that simply wraps an underlying array without ever exposing it. Naming wise, it makes sense to name it ImmutableArray&lt;T&gt;. It wouldn&rsquo;t have persistent character though, as we wouldn&rsquo;t offer any methods to create new versions with different values. If you wanted this behavior, you should use ImmutableList&lt;T&gt; instead. The goal of ImmutableArray&lt;T&gt; is simply to provide a low overhead wrapper around an array to enforce it can never change.</p>
<p>To me this indicates that &ldquo;immutable&rdquo; is a more useful term for the BCL as it is precise and yet general purpose enough to not require adding more terminology down the road when the design evolves.</p>
<h2>The Small Things Count</h2>
<p>We&rsquo;ve also improved several smaller things, for example, we&rsquo;ve added a <span style="font-family: Consolas;">ImmutableList&lt;T&gt;.RemoveRange(IEnumerable&lt;T&gt;)</span> method. The existing remove range that took an index and a count was not super useful in mainstream scenarios.</p>
<h1>Hold on &ndash; aren&rsquo;t those breaking changes?</h1>
<p>Yes! The NuGet package is marked as a &ldquo;pre-release&rdquo;. Pre-release packages are non-stable previews of a product. That is, we don&rsquo;t guarantee the final shape of the API and/or functionality and want to be able to change them based on customer feedback. In the end, the sole purpose of pre-release packages is gathering feedback.</p>
<p>That is a very different experience from a beta of the .NET Framework. Typically, a beta is the first public release of the framework but it is already very close to RTM. In fact, for .NET 4.5 we shipped the beta with a go-live license that supports use in production. On one hand, this is great for early adopters, but on the other hand it means we couldn&rsquo;t react to major design change requests because the design was already set.</p>
<p>Pre-releases on NuGet allow us to give you the bits really early and react to your feedback in a meaningful way. For example, if changing the API shape is the right thing, we&rsquo;ll do it.</p>
<p>However, once we mark packages as stable (AKA &ldquo;RTM&rdquo;) we hold the same bar for breaking changes as in-box .NET Framework components.</p>
<h1>Summary</h1>
<p>Please try out the new drop of immutable collections. If you&rsquo;re already using them, you can simply upgrade your existing packages via the NuGet package manager. Otherwise, just search for Microsoft.Bcl.Immutable and make sure you include pre-releases.</p>
<p>Looking forward to receiving more feedback!</p>]]></content:encoded>
    </item>
    <item>
      <title>Portable HttpClient for .NET Framework and Windows Phone</title>
      <link>https://docs.microsoft.com/archive/blogs/bclteam/portable-httpclient-for-net-framework-and-windows-phone</link>
      <pubDate>Mon, 18 Feb 2013 10:00:00 GMT</pubDate>
      <dc:creator><![CDATA[Immo Landwerth [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/bclteam/2013/02/18/portable-httpclient-for-net-framework-and-windows-phone/</guid>
      <description><![CDATA[Many of you told us you want HttpClient for Windows Phone. In this post, Alok Shriram, a Program...]]></description>
      <content:encoded><![CDATA[<p style="text-align: justify; padding-left: 30px;"><em>Many of you told us you want HttpClient for Windows Phone. In this post, </em><strong><em>Alok Shriram, a Program Manager on the .NET Framework team</em></strong><em>, will talk about an important announcement of ours. &ndash;Immo </em></p>
<p>Today we&nbsp;are announcing our Beta release of the <a title="portable version of HttpClient" href="https://nuget.org/packages/Microsoft.Net.Http">portable version of HttpClient</a>, the modern networking API. The HttpClient library is a set of APIs for .NET which provide a flexible and extensible way to access all things exposed through HTTP.</p>
<p>This release of HttpClient adds support for the following platforms:</p>
<ul>
<li>.NET framework 4.0</li>
<li>Windows Phone 7.5 and higher</li>
<li>Portable class libraries</li>
</ul>
<h1>What&nbsp;does HttpClient do?</h1>
<p>HttpClient is a part of .NET Framework 4.5 and Windows Store apps that provides developers an extremely easy way to connect with services across the internet including REST-based services. In fact, the methods exposed by HttpClient are the same verbs the HTTP protocol uses to communicate like GET/PUT/POST/DELETE.</p>
<p>In order to get some content from a web server say www.contoso.com we can write the following simple lines of code</p>
<pre style="padding-left: 30px;"><span style="font-family: courier new,courier;">HttpClient httpClient = new HttpClient();<br /></span><span style="font-family: courier new,courier;">string responseBodyAsText = await httpClient.GetStringAsync(&ldquo;www.contoso.com&rdquo;);</span>
</pre>
<p>&hellip;and get a response back from a web service. Obviously this is the simplest example, and the HttpClient library has many more feature and functions.</p>
<h1>Why a portable HttpClient?</h1>
<p>Before releasing this package, the HttpClient class was not available on all platforms. This complicated the experience for developers trying to share code across Microsoft platforms. For instance, a developer who wanted to target both the Windows Phone and Windows Store app platforms would need to write networking logic using the HttpWebRequest and HttpWebResponse classes for networking, since it was the networking abstraction available in portable. However HttpClient is a much simpler programming interface to code against, in addition to being very close to HTTP semantics, which makes it more intuitive. In addition HttpClient exposes the new Task based asynchronous methods, which makes writing responsive and performant UI applications across all platforms&nbsp;a lot simpler.</p>
<p>In order to bridge this gap we have created a portable class library for HttpClient that will allow developers to consume HttpClient on Windows Phone 7.5 and higher, Windows Store apps, and .NET Framework 4.0 and higher. In addition it also enables other portable library developers who require networking support to use HttpClient while targeting all or a subset of the supported platforms.</p>
<h1>What do I need?</h1>
<p>In order to use this release of HttpClient you need to ensure that you have two things.</p>
<ul>
<li>Visual Studio 2010 (for .NET 4.0 Windows Phone 7.1) or Visual Studio 2012 (required for .NET 4.5, Windows Store and Windows Phone 8).</li>
<li>The NuGet package manager version 2.1 or higher.</li>
</ul>
<p>To use the HttpClient package, right click on your solution, go to the Manage Nuget Packages dialog, search for Id Microsoft.Net.Http, and make sure &ldquo;Include Prerelease&rdquo; is turned on.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/8015.HttpClient_1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/8015.HttpClient_5F00_1.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/8015.HttpClient_1.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/8015.HttpClient_5F00_1.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>Accept the license terms and agreements and NuGet will install the right packages to your folder.</p>
<h1>Writing a Cross platform App</h1>
<p>The full surface area for HttpClient as shipped in .NET Framework 4.5 is documented <a href="https://msdn.microsoft.com/en-us/library/hh193681(v=vs.110)">here</a>. This package includes support for that surface area, and introduces a few new methods that are not currently in the documentation above.These new APIs are used to help determine which networking capabilities are supported on the platform on which you&rsquo;re running, since not all platforms support all capabilities. The new APIs added are:</p>
<pre style="padding-left: 30px;"><span style="font-family: courier new,courier;">public static bool SupportsPreAuthenticate(this HttpClientHandler handler);<br /></span><span style="font-family: courier new,courier;">public static bool SupportsProtocolVersion(this HttpClientHandler handler);<br /></span><span style="font-family: courier new,courier;">public static bool SupportsTransferEncodingChunked(this HttpClientHandler handler);</span>
</pre>
<p>In order to write a portable piece of code which would work across all the supported platforms, code that would have previously been</p>
<pre style="padding-left: 30px;"><span style="font-family: courier new,courier;">HttpClientHandler handler = new HttpClientHandler();<br /></span><span style="font-family: courier new,courier;">httpClient = new HttpClient(handler);<br /></span><span style="font-family: courier new,courier;">HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, resourceAddress);<br /></span><span style="font-family: courier new,courier;">request.Content = streamContent;<br /></span><span style="font-family: courier new,courier;">request.Headers.TransferEncodingChunked = true;<br /></span><span style="font-family: courier new,courier;">HttpResponseMessage response = await httpClient.SendAsync(request);</span>
</pre>
<p>Will now change to</p>
<pre style="padding-left: 30px;"><span style="font-family: courier new,courier;">HttpClientHandler handler = new HttpClientHandler();<br /></span><span style="font-family: courier new,courier;">httpClient = new HttpClient(handler);<br /></span><span style="font-family: courier new,courier;">HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, resourceAddress);<br /></span><span style="font-family: courier new,courier;">request.Content = streamContent;<br /></span><span style="font-family: courier new,courier;">if (handler.SupportsTransferEncodingChunked())<br /></span><span style="font-family: courier new,courier;">{<br /> </span><span style="font-family: courier new,courier;">request.Headers.TransferEncodingChunked = true;<br /></span><span style="font-family: courier new,courier;">}<br /></span><span style="font-family: courier new,courier;">HttpResponseMessage response = await httpClient.SendAsync(request);</span>
</pre>
<h1>Using HttpClient on .NET Framework 4.0 or Windows Phone 7.5</h1>
<p>If you are writing a cross platform app targeting .Net 4.0 or the windows phone and write the code that you had written above you will get a compile error.</p>
<p><span style="color: red;">&ldquo;Cannot await System.Threading.Task&lt;HttpRequestMessage&gt;&rdquo;</span></p>
<p>This is because .Net 4.0 and Windows Phone 7.5 did not support the async/await keywords.In order to fix this add a reference to the Microsoft.Bcl.Async nuget package, which adds the support for Async and Await in down level platforms.To read more about this release go <a href="https://blogs.msdn.com/b/bclteam/archive/2012/10/22/using-async-await-without-net-framework-4-5.aspx">here</a>.</p>
<p><a href="https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3158400-add-httpclient-in-portable-class-library-pcl-?tracking_code=02eea86a2711ee54158af1caf8ff21a1"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/30/50/3733.HttpClient_2.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-30-50/3733.HttpClient_5F00_2.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>This was one of the higher rated user voice requests, so thanks for taking the time to engage with us. Please note this package is marked as prerelease software &ndash; that is, there are some rough edges to be expected. We&rsquo;ve published the known issues <a href="https://blogs.msdn.com/b/bclteam/p/httpclient.aspx">here</a>. As usual, we&rsquo;d like to know if you run into any issues when using it. Simply use the comment section under this blog post.</p>
<p>Happy &ldquo;Get&rdquo;ting!</p>]]></content:encoded>
    </item>
  </channel>
</rss>