在.NET 4.0中我还暂无数据异步/等待关键词 [英] in .net 4.0 I have not avaliable the async/await keywords

查看:165
本文介绍了在.NET 4.0中我还暂无数据异步/等待关键词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用异步/地等待着C#4.0和我已经安装了这个软件包:

I would like to use the async/await in C# 4.0 and I have installed this package:

<一个href=\"http://www.nuget.org/packages/Microsoft.Bcl.Async/\">http://www.nuget.org/packages/Microsoft.Bcl.Async/

问题是,我还暂无数据异步/等待关键字。

The problem is that I have not avaliable the async/await keywords.

我使用VS2010 SP1的。

I am using VS2010 with SP1.

感谢。

推荐答案

你不会得到一个更好的答案比全碟

You're not going to get a better answer than Jon Skeet's.

支持的唯一的方法做,这是使用 VS2012 Microsoft.Bcl.Async

The only supported way to do this is to use VS2012 with Microsoft.Bcl.Async.

VS2010是很难得到与工作异步 / 等待。有一个古老的异步CTP包(其中有许多臭虫未曾是固定的),即充当了附加/部分替代来VS2010。然而,数据包从未与VS2010更新行之有效。所以,你必须先找到一个老版本的CTP安装程序之一的,玩弄安装的部分的VS更新,然后看看是否CTP工作。如果您已经安装所有更新VS2010则没有版本的CTP将工作。我的认为的,一旦你找到一个更新的情况下,你可以安装一个工作CTP,的然后的可以安装其他更新。

VS2010 is very difficult to get working with async/await. There was an old Async CTP package (which had many bugs that were never fixed) that acted as an "add-on"/"partial replacement" to VS2010. However, that package never worked well with the VS2010 updates. So, you'd have to first find a version of one of the old CTP installers, play around with installing some VS updates, and then see if the CTP works. If you've already installed all your VS2010 updates then no version of the CTP will work. I think once you find an update situation where you can install a working CTP, then you can install the other updates.

所有这些工作之后,你还是会落得的异步一个bug缠身(绝对未优化)的实现。

After all this work, you'll still end up with a bug-ridden (and definitely unoptimized) implementation of async.

,你可以做乔恩斯基特建议和下载VS2012前preSS的免费版本 Microsoft.Bcl.Async 并有一个完全支持的解决方案。

Or, you can do as Jon Skeet suggested and download the free version of VS2012 Express with Microsoft.Bcl.Async and have a fully supported solution.

这篇关于在.NET 4.0中我还暂无数据异步/等待关键词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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