简体   繁体   中英

Await/Async .net 4.0

Per this SO question . StephenCleary states not to use 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

Why would this not be recommended by someone who wrought the book Concurrancy and C# ?

.Net 4.0 supports await perfectly fine with the compatibility pack.

However, ASP .Net 4.0 does not, because it makes far more assumptions about the async model.

Using await in ASP.Net requires a better SynchronizationContext , which was added in 4.5 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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