Microsoft.Bcl.Async is Now Stable

Microsoft.Bcl.Async is Now Stable

Rate This
  • Comments 49

It’s done. About five months ago, we shipped our Microsoft.Bcl.Async 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.

We believe we’ve baked Microsoft.Bcl.Async 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.


C-3PO: "Sir, it's quite possible this package is not entirely stable."

Han Solo: "Not entirely stable? Well, I'm glad you're here to tell us

these things. Chewie, take the professor in the back and

show him how to upgrade the NuGet package!"

--- Star Wars as Immo remembers it

What’s the big deal with being stable?

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.

What about Microsoft.CompilerServices.AsyncTargetingPack?

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 (“Async Targeting Pack”)

https://www.nuget.org/packages/Microsoft.CompilerServices.AsyncTargetingPack

Our stable release of Microsoft.Bcl.Async officially supersedes the Async Targeting Pack. We haven’t removed it, but we unlisted it on NuGet so that new developers aren’t accidentally using the old version. We’ve also added a readme.txt which is automatically displayed by VS when existing consumers upgrade their package references.

Fixed Issues

The majority of customer issues we’ve seen was due to two issues:

  1. Outdated version of NuGet. In order to use the Async package from a portable class library, you need to run the NuGet 2.1 or higher. To address this in the future, we have worked with the NuGet team and NuGet 2.3 will add this ability. For now, you will need to know to install an updated version of NuGet (see instructions in section “How to Upgrade” below).
  2. Missing reference to the async package from all referencing projects. 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’ve added a warning mechanism to our package that tells you what to do. I’ll discuss this in more detail below.

After upgrading, you will see the following build warning:

 

After fixing this, you might see the following warnings:

In both cases, the project that causes the warning is missing a NuGet package reference. Adding these references will fix the warnings.

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 Manage NuGet Packages for Solution. Select the NuGet package and click Manage. A dialog appears that enables you to select the projects you want to update.

Add references for Microsoft.Bcl, Microsoft.Bcl.Async, and Microsoft.Bcl.Build to all projects that show the warnings mentioned previously.

Branding

We’ve added some branding to make our packages easier to recognize. Our dotnetframework user now displays the .NET gravatar.

 

and so does our async NuGet package:

 

How to Upgrade

Important: Since our package contains portable class libraries, you need to use NuGet 2.1 or higher. You can check whether you have the latest version by going to Tools | Extensions and Updates. When the Extensions and Updates dialog opens, select Updates | Visual Studio Gallery and look for an entry titled NuGet Package Manager.

In order to upgrade to the RTM version, right click your project and select Manage NuGet Packages. In the resulting dialog, select the Updates section on the left hand side. In the center, the Async NuGet package should show up. Simply click the Update button.

Summary

Microsoft.Bcl.Async 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’t work for you. You can contact us via comments under this blog posts or via our NuGet contact page. Also, make sure to check out the known issues list.

  • Using VS 2012 I was getting the same error like Kent Boogart for my .net 4 project.

    Then I found this workaround.  I did have a missing culture in one of the elements.  After applying the workaround it worked.

    ------------------------------------------------------------------

    Workaround

    ------------------------------------------------------------------

    connect.microsoft.com/.../microsoft-bcl-build-1-0-5-fails-when-dependentassembly-is-missing-a-culture-attribute

    Open your project's web/app.config and look for any configuration/runtime/assemblyBinding/dependentAssembly/assemblyIdentity that are missing a culture attribute and add culture="neutral". Clean and rebuild.

    ------------------------------------------------------------------

    But now I have another minor issue where inside the app.config assemblyBinding I have a probing element that gets erased every time I build the solution!

  • Building my silverlight project is just fine. But FxCop code analysis fails with the following error. Any thoughts?

    Unresolved  : 'Microsoft.Threading.Tasks' reference to System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.

    The indirectly-referenced assembly 'System.Runtime, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' could not be found. This assembly is not required for analysis, however, analysis results could be incomplete. This assembly was referenced by: E:\packages\Microsoft.Bcl.Async.1.0.16\lib\sl4\Microsoft.Threading.Tasks.dll.

  • When I run Code Analysis from within Visual Studio 2012 Premium, I get the following error:

    CA0001 Error Running Code Analysis CA0001 : The following error was encountered while reading module 'ConsoleApplication1': Could not resolve member reference: [Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]System.Threading.Tasks.TaskEx::Delay. [Errors and Warnings] (Global)

    Microsoft.Threading.Tasks.dll (v1.0.12) is located in the output folder together will all other dependencies and the application is running just fine.

    Is it a problem with code analysis? And is there any workaround or a fix in the works?

  • man i've got the 2.0.5.0 type error  in Win8  but  KB2468871 cannot be installed  in win8.  what should i do...

Page 4 of 4 (49 items) 1234