JohanTG
JohanTG

Reputation: 1357

What is Microsoft.Bcl.Async?

What is Microsoft.Bcl.Async and what is it used for?

I've read on the package page that:

This package enables Visual Studio 2012 projects to use the new 'async' and 'await' keywords.

But as could see my VS2012 supports async and await without any extra package.

So should I install the package for my C# 4.5 'async' project?

Upvotes: 10

Views: 9535

Answers (2)

Stephen Cleary
Stephen Cleary

Reputation: 456717

Microsoft.Bcl.Async provides the runtime types that the C# 5.0 compiler needs to use async and await.

It brings async/await support to .NET 4.0, Silverlight 4 and 5, Windows Phone Silverlight 7.1/7.5, and portable libraries that include any of those platforms. It also provides some extension methods on the Windows Phone Silverlight 8.0 platform, so it's sometimes used there even though WP8 can support async/await without it.

It does not include the ASP.NET runtime changes necessary for proper async/await support, so if you install it into an ASP.NET 4.0 project, the code will compile but will not work correctly. The only supported way to use async/await on ASP.NET is to upgrade to 4.5.

Upvotes: 18

Michael Mairegger
Michael Mairegger

Reputation: 7301

It is a package to be able to use async and await in .NET 4.0 projects.

But be aware. I encountered the problem where these libraries cannot be used in .NET 4.5 projects. But this was before the initial release of .NET 4.5. Therefore this problem might be resolved.

Upvotes: 10

Related Questions