I'm currently starting to create an application that would profit a lot from C# 5's async-await feature. But I'm not sure which version of VS and of the async runtime to use.

Looking at OS popularity charts, I'll need to support Windows XP for another three years or so. It looks like .net 4.5 runs only on newer versions of Windows, so I need to target .net 4.0. The development machines use Windows 7, so using a newer version of VS is not a problem.

Now I need to first choose a compiler for doing this:

  • VS2010 with AsyncCTP
  • VS2012 Preview (and final once it arrives), setting the target to .net 4.0
  • Mono (Looks like 2.12 has async-await, I prefer/am used to VS over MonoDevelop as IDE)

Which one has fewer code-gen bugs? Looking at Jon Skeet's blog the VS2012 Preview uses a never code-generator than the CTP.

And more importantly which runtime to use?

Does VS2012 contain a redistributable async runtime for use with .net 4?

I managed to compile code, with the preview, by referencing the AsyncCTP runtime. But since the CTP has strange licensing conditions, that doesn't look like a good long term solution.

Or should I use a third party implementation? Perhaps mono has one?

For distributing the library I prefer simply putting the dll in the same directory as the application, instead of some kind of installer.

I'd also like it if my binaries would work without changes on mono+Linux/MacOS. So the runtime should either be compatible with whatever mono (2.12 probably) has built in, or allow use on non windows OSs.

Microsoft released the Async Targeting Pack (Microsoft.Bcl.Async) through Nuget as a replacement for the AsyncCTP.

You can read more about it here: http://blogs.msdn.com/b/bclteam/archive/2013/04/17/microsoft-bcl-async-is-now-stable.aspx.

You can read about the previous version here: http://blogs.msdn.com/b/lucian/archive/2012/04/24/async-targeting-pack.aspx.

As this pack is officially supported, I now believe the best option for targeting XP + async would be using Visual Studio 2012 + C#5 + Async Targeting Pack.

If you feel the need to target .NET 3.5 though, you can still use (my) AsyncBridge for .NET 3.5.

from:http://stackoverflow.com/questions/9110472/using-async-await-on-net-4

Using async-await on .net 4的更多相关文章

  1. async & await 的前世今生(Updated)

    async 和 await 出现在C# 5.0之后,给并行编程带来了不少的方便,特别是当在MVC中的Action也变成async之后,有点开始什么都是async的味道了.但是这也给我们编程埋下了一些隐 ...

  2. [.NET] 利用 async & await 的异步编程

    利用 async & await 的异步编程 [博主]反骨仔 [出处]http://www.cnblogs.com/liqingwen/p/5922573.html  目录 异步编程的简介 异 ...

  3. [.NET] 怎样使用 async & await 一步步将同步代码转换为异步编程

    怎样使用 async & await 一步步将同步代码转换为异步编程 [博主]反骨仔 [出处]http://www.cnblogs.com/liqingwen/p/6079707.html  ...

  4. [.NET] 利用 async & await 进行异步 IO 操作

    利用 async & await 进行异步 IO 操作 [博主]反骨仔 [出处]http://www.cnblogs.com/liqingwen/p/6082673.html  序 上次,博主 ...

  5. [C#] 走进异步编程的世界 - 开始接触 async/await

    走进异步编程的世界 - 开始接触 async/await 序 这是学习异步编程的入门篇. 涉及 C# 5.0 引入的 async/await,但在控制台输出示例时经常会采用 C# 6.0 的 $&qu ...

  6. ASP.NET 中的 Async/Await 简介

    本文转载自MSDN 作者:Stephen Cleary 原文地址:https://msdn.microsoft.com/en-us/magazine/dn802603.aspx 大多数有关 async ...

  7. C# async/await 使用总结

    今天搞这两个关键字搞得有点晕,主要还是没有彻底理解其中的原理. 混淆了一个调用异步方法的概念: 在调用异步方法时,虽然方法返回一个 Task,但是其中的代码已经开始执行.该方法在调用时,即刻执行了一部 ...

  8. 【转】async & await 的前世今生

    async 和 await 出现在C# 5.0之后,给并行编程带来了不少的方便,特别是当在MVC中的Action也变成async之后,有点开始什么都是async的味道了.但是这也给我们编程埋下了一些隐 ...

  9. async & await 的前世今生

    async 和 await 出现在C# 5.0之后,给并行编程带来了不少的方便,特别是当在MVC中的Action也变成async之后,有点开始什么都是async的味道了.但是这也给我们编程埋下了一些隐 ...

  10. C# Async, Await and using statements

    Async, Await 是基于 .NEt 4.5架构的, 用于处理异步,防止死锁的方法的开始和结束, 提高程序的响应能力.比如: Application area           Support ...

随机推荐

  1. Windows下Mongodb启动问题

    把mongodb安装完,运行server出现问题

  2. python全栈开发day61-django简单的出版社网站展示,添加,删除,编辑(单表的增删改查)

    day61 django内容回顾: 1. 下载: pip install django==1.11.14 pip install -i 源 django==1.11.14 pycharm 2. 创建项 ...

  3. 【转】 诡异的ORA-02289: sequence does not exist

    原文地址:http://blog.itpub.net/20801486/viewspace-695651/ 今天被开发人员告知在应用用户下无法查询自己创建的sequence的nextval值.当执行s ...

  4. ng2tree在ios中无法触发click

    问题描述: 从其他页面跳转回ng2tree的页面时,无法触发节点的click事件 解决方案: 1. 在node_modules中搜索onNodeSeclected方法,修改click为touchend ...

  5. Codeforces 653F Paper task SA

    Paper task 如果不要求本质不同直接st表二分找出最右端, 然后计数就好了. 要求本质不同, 先求个sa, 然后用lcp求本质不同就好啦. #include<bits/stdc++.h& ...

  6. POJ1459 Power Network 网络流 最大流

    原文链接http://www.cnblogs.com/zhouzhendong/p/8326021.html 题目传送门 - POJ1459 题意概括 多组数据. 对于每一组数据,首先一个数n,表示有 ...

  7. javaNIO的总结

    放大1.5倍查看 使用NIO对文件进行COPY操作 public class TestNIOCopyFile { public static void main(String[] args) thro ...

  8. Python isinstance 方法 判断 built-in types(内置类型)技巧

    Python isinstance 方法 判断 built-in types(内置类型)技巧 d = {} isinstance(d, type({})) isinstance(d, dict) l ...

  9. tp5数据库链接

    1在config/database.php中配置 1.1直接 return [ // 数据库类型 'type' => 'mysql', // 服务器地址 'hostname' => '12 ...

  10. TF之AE:AE实现TF自带数据集数字真实值对比AE先encoder后decoder预测数字的精确对比—Jason niu

    import tensorflow as tf import numpy as np import matplotlib.pyplot as plt #Import MNIST data from t ...