码迷,mamicode.com
首页 > Web开发 > 详细

如何在.net4.0中使用.net4.5的async/await

时间:2018-01-22 11:15:06      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:href   exce   token   方式   from   could   下载   and   result   

一般喜欢学习新技术的同学都用过.net4.5吧,那肯定会被简单、高效的异步编程模型所吸引吧。

去年微软发布了Microsoft.Bcl.Async,该包由三个库组成:Microsoft.Bcl、Microsoft.Bcl.Async和Microsoft.Bcl.Build。

 

技术分享图片

技术分享图片

 

相关文章可以参考:

Microsoft.Bcl.Async is Now Stable
async 与 await 在 Web 下的应用

 

可能会碰到的问题:

1、出现编译异常

那需要你检查一下各项目中是否都有引用。由于使用了程序集统一的方式,解决方案中的所有工程都必须引用这三个库。

2、使用异常

如果异常信息是“Message : Could not load file or assembly ‘System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes‘ or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)”,

那需要你去微软官网下载.net4.0的KB2468871补丁来安装。

 

http://www.cnblogs.com/hj4444/p/3857771.html

如何在.net4.0中使用.net4.5的async/await

标签:href   exce   token   方式   from   could   下载   and   result   

原文地址:https://www.cnblogs.com/tianciliangen/p/8327670.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!