gpt4 book ai didi

.net - Microsoft.CompilerServices.AsyncTargetingPack 和 Microsoft.Bcl.Async 之间有什么区别?

转载 作者:行者123 更新时间:2023-12-02 14:14:04 25 4
gpt4 key购买 nike

我正在搜索 NuGet 以找到允许您在 .net 4.0 项目中使用 async/await 的库。我本来是在寻找Async for .NET Framework 4, Silverlight 4 and 5, and Windows Phone 7.5 and 8然而我发现Async Targeting Pack for Visual Studio 11相反。

这两个包有什么区别,什么时候应该使用哪个?

Async for .NET Framework 4, Silverlight 4 and 5, and Windows Phone 7.5 and 8

This package enables Visual Studio 2012 projects targeting .NETFramework 4 (with KB2468871), Silverlight 4 and 5, and Windows Phone7.5 (including any portable library combinations) to use the new 'async' and 'await' keywords. This package also includes Task-basedextension methods that allow using some of the existing asynchronousAPIs with the new language keywords. Windows Phone 8 projects can usethis package to get access to async extension methods for thenetworking types.

This package is not supported in Visual Studio 2010, and is only required for projects targeting .NET Framework 4.5 or .NET for Windows Store apps when consuming a library that uses this package. For known issues, please see: http://blogs.msdn.com/b/bclteam/p/asynctargetingpackkb.aspx.


Async Targeting Pack for Visual Studio 11

The "Async Targeting Pack for Visual Studio 11" enables projects targeting .NET Framework4.0 or Silverlight 5 to use the Async language feature in C# and Visual Basic.

This pack requires Visual Studio 11 and will not work with VisualStudio 2010.

The pack contains the API support necessary to use the 'async' and'await' keywords in C# 5.0 and Visual Basic 11, as well as a set ofTask-based adapter APIs that allow using some of the existingasynchronous APIs with the new language keywords.

This targeting pack is not required for projects targeting .NET Framework 4.5 or .NET for Metro style apps. It is only required for projects targeting Silverlight 5 and .NET Framework 4.0. Earlier platform releases are not supported.

最佳答案

Microsoft.Bcl.Async 取代 Microsoft.CompilerServices.AsyncTargetingPack。定位包保留在 NuGet 中,因此已经使用过它的人仍然可以为他们的项目重新下载它。

参见this MSDN article了解更多信息。

关于.net - Microsoft.CompilerServices.AsyncTargetingPack 和 Microsoft.Bcl.Async 之间有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17330472/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com