简体   繁体   English

Await / Async .net 4.0

[英]Await/Async .net 4.0

Per this SO question . 根据这个问题 StephenCleary states not to use Async Compatablity Pack. StephenCleary声明不要使用Async Compatablity Pack。

When researching this more fully I have come across MSDN posts on how to use it and why, I have come across SO posts on how to use it and best practices, and the NuGet Gallery states that it is designed for .net 4.0 在更充分地研究这个问题时,我遇到了关于如何使用它的MSDN帖子以及为什么,我已经看到了关于如何使用它和最佳实践的SO帖子,而NuGet Gallery声称它是专为.net 4.0设计的。

Why would this not be recommended by someone who wrought the book Concurrancy and C# ? 为什么这不会被制作Concurrancy和C#一书的人推荐?

.Net 4.0 supports await perfectly fine with the compatibility pack. .Net 4.0支持兼容包, await完美。

However, ASP .Net 4.0 does not, because it makes far more assumptions about the async model. 但是, ASP .Net 4.0没有,因为它对异步模型做出了更多的假设。

Using await in ASP.Net requires a better SynchronizationContext , which was added in 4.5 . 在ASP.Net中使用await需要一个更好的SynchronizationContext ,它在4.5添加

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM