简体   繁体   中英

how to use asyn/await with .net 4.0? differences between AsyncTargetingPack and Microsoft.Bcl.Async?

I would like to use async/await with C# 4.0, and until know, I have used async CTP v3, but it seems that is a bad option, more if I am using VS2012.

In VS2012, there are at least two options, Microsoft.CompilerServices.AsyncTargetingPack and Microsoft.Bcl.Async.

The first one, Microsoft.Bcl.Async (Bcl), has been released later than AsyncTargetingPack (ATP), but Bcl is beta.

However, ATP is for projects whose target is silver light 5 or .NET 4.0, and Bcl it seems that is comaptible with silver light 4, silver light 5, Windows Phone 7.5 and .NET 4.0.

ATP is deprecated? are both compatibles or they are differents implementations and if I use one I always must to use the same?

Which is the best option?

AsyncTargetingPack has been renamed to Microsoft.Bcl.Async ; the latter is merely an updated version of the former, not a new separate implementation. In this case, I'd simply go with the newest version, even if it is a prerelease, in order to avoid problems when you later have to update to the new NuGet package name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM