如何使用Visual Studio 2010和.NET 4.0异步? [英] How to use async with Visual Studio 2010 and .NET 4.0?

查看:439
本文介绍了如何使用Visual Studio 2010和.NET 4.0异步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要异步支持添加到当前的VS 2010的.NET 4.0的C#项目

I want to add async support to current VS 2010 .NET 4.0 C# project

我已经找到:


  • 的Visual Studio异步CTP - <一个href=\"http://www.microsoft.com/en-us/download/details.aspx?id=9983\">http://www.microsoft.com/en-us/download/details.aspx?id=9983

  • Microsoft.Bcl.Async - <一个href=\"https://nuget.org/packages/Microsoft.Bcl.Async\">https://nuget.org/packages/Microsoft.Bcl.Async

我甚至不得到它们之间真正的区别。

I don't even get real difference between them.

我安装了。 Visual Studio的异步CTP(第3版),Microsoft.Bcl和Microsoft.Bcl.Async。 (也可用于运行Microsoft.Bcl 工具\\便携式net40 + SL4 + win8的+ wp71 \\ install.ps1

I installed both. Visual Studio Async CTP (Version 3), Microsoft.Bcl and Microsoft.Bcl.Async. (also used to run tools\portable-net40+sl4+win8+wp71\install.ps1 in Microsoft.Bcl)

和依然看不到任何效果。对于同样的错误。

And still can't see any effect. Same error for

public async Task<CommResponse>

- >

Error   37  The type or namespace name 'async' could not be found (are you missing a using directive or an assembly reference?)

因此​​,它是真正的我应该怎么用这个东西吗?

So is it real how should I use this stuff?

推荐答案

我不认为你应该这样做。在Visual Studio 2010年版异步电动机/等待更多的是preVIEW比什么都重要的。如果你想在真实的生产水平code使用这个,你一定要升级到Visual Studio 2012中(或2013年,如果你能等待一小会儿)。

I don't think you should do that. The Visual Studio 2010 version of async/await is more of a preview than anything else. If you want to use this in real, production level code, you should definitely upgrade to Visual Studio 2012 (or 2013, if you can wait a little while).

如果你不需要这些实际生产code这么做出于某些原因需要的Visual Studio Pro和只是玩弄你身边,你可以使用Visual Studio 2012中前preSS。

If you don't need this in real production code that requires Visual Studio Pro for some reason, and are just toying around, you can use Visual Studio 2012 Express.

这篇关于如何使用Visual Studio 2010和.NET 4.0异步?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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