如何在 target.net 4.0 项目中使用异步关键字 [英] How can I use the async keywords in a project targeting.net 4.0

查看:22
本文介绍了如何在 target.net 4.0 项目中使用异步关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 .net 4.0 中创建的项目中使用 async 关键字.

I would like to use the async keywords in a project that is created in .net 4.0.

如果我访问 nuget.org 网站并寻找async",我会得到很多结果,但主要是我得到了这个:

If I go to the nuget.org website and I look for "async", i many results, but mainly I get this:

Visual Studio 异步 CTP(第 3 版,非官方)0.3.0

AsyncAwaitCTP 1.0.0

两者的区别是什么?

推荐答案

您想要 Microsoft.Bcl.Async 包.这是一个正确发布的、稳定的非 CTP 包.这也需要 VS2012,因为需要更新的编译器来理解 asyncawait.

You want the Microsoft.Bcl.Async package. That's a properly released, non-CTP package that is stable. This also requires VS2012 since an updated compiler is needed to understand async and await.

理论上,可以将 VS2010 中的旧工具与旧 CTP 库一起使用,我强烈建议您不要使用 - 它有错误,而且安装本身就是一个偶然性.

In theory one could use older tools from VS2010 along with the older CTP library, I'd strongly recommend that you don't - it has bugs and the installation itself is a hit-or-miss.

这篇关于如何在 target.net 4.0 项目中使用异步关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆