问题描述
我想用异步/等待着C#4.0,直到知道了,我已经使用异步CTP V3,但似乎这是一个坏的选择,更多,如果我使用VS2012。
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.
在VS2012,至少有两种选择,Microsoft.CompilerServices.AsyncTargetingPack和Microsoft.Bcl.Async
In VS2012, there are at least two options, Microsoft.CompilerServices.AsyncTargetingPack and Microsoft.Bcl.Async.
第一个,Microsoft.Bcl.Async(BCL),已经陆续公布比AsyncTargetingPack(ATP),但BCL是测试版。
The first one, Microsoft.Bcl.Async (Bcl), has been released later than AsyncTargetingPack (ATP), but Bcl is beta.
不过,ATP是项目,其目标是银色光5或.NET 4.0,和Bcl似乎是comaptible与银色光4,银亮5的Windows Phone 7.5和.NET 4.0。
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是德precated?都是兼容机或者它们型动物的实现,如果我用一个我必须总是使用相同的?
ATP is deprecated? are both compatibles or they are differents implementations and if I use one I always must to use the same?
这是最好的选择吗?
推荐答案
AsyncTargetingPack已更名为Microsoft.Bcl.Async ;后者仅仅是前者,而不是一个新的,独立执行情况的最新版本。在这种情况下,我会简单地用最新版本去,哪怕是一个$ P $租赁前,为了避免出现问题时,你以后要更新到新的NuGet包名。
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.
这篇关于如何使用ASYN /等待与.NET 4.0? AsyncTargetingPack和Microsoft.Bcl.Async之间的差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!