如何在.net4.0中使用.net4.5的async/await
2015-07-06 16:35
591 查看
推荐文章:
http://www.cnblogs.com/hj4444/p/3857771.html
/article/5207529.html
一般喜欢学习新技术的同学都用过.net4.5吧,那肯定会被简单、高效的异步编程模型所吸引吧。
去年微软发布了Microsoft.Bcl.Async,该包由三个库组成:Microsoft.Bcl、Microsoft.Bcl.Async和Microsoft.Bcl.Build。
、
或者直接在PM命令中输入:
PM> Install-Package Microsoft.Bcl.Async
相关文章可以参考:
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补丁来安装。
KB2468871补丁-支持的操作系统
Windows 7 Service Pack 1, Windows Server 2003 Service Pack 2, Windows Server 2008, Windows Server 2008 R2 SP1, Windows Vista Service Pack 1, Windows XP Service Pack 3
http://www.cnblogs.com/hj4444/p/3857771.html
/article/5207529.html
一般喜欢学习新技术的同学都用过.net4.5吧,那肯定会被简单、高效的异步编程模型所吸引吧。
去年微软发布了Microsoft.Bcl.Async,该包由三个库组成:Microsoft.Bcl、Microsoft.Bcl.Async和Microsoft.Bcl.Build。
、
或者直接在PM命令中输入:
PM> Install-Package Microsoft.Bcl.Async
相关文章可以参考:
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补丁来安装。
KB2468871补丁-支持的操作系统
Windows 7 Service Pack 1, Windows Server 2003 Service Pack 2, Windows Server 2008, Windows Server 2008 R2 SP1, Windows Vista Service Pack 1, Windows XP Service Pack 3
相关文章推荐
- AIX 5L 系统管理技术 —— 存储管理——物理卷
- Adobe Air移动开发本人体会
- Factorial Trailing Zeroes
- hive执行计划EXPLAIN
- 两个有序数组,从中各取一个组成pair,求和最小的前K个pair(杨氏矩阵top k问题)
- handler和runOnMainThread更新界面问题
- 如何设置SSH服务终端的超时时间或不超时
- pthread_cond_signal和pthread_cond_wait简介
- Exchange2010配置-多邮箱搜索发现 推荐
- 翻墙用青蛙加速器,上google,youtube,gmail必备
- climbing-stairs
- 正确使用Block避免Cycle Retain和Crash
- uva573 The Snail
- C传递参数给main函数
- hdu 4460 Friend Chains(最短路径,spfa)
- UVA 253 Cube painting
- openwebmail
- How do I change the schedule for replication between two domain controllers in a site?
- How to force replication of Domain Controllers
- 中兴通讯携智慧轨道(iRail)解决方案参加非洲轨交展