Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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#?

like image 322
gh9 Avatar asked Dec 06 '25 01:12

gh9


1 Answers

.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.

like image 186
SLaks Avatar answered Dec 08 '25 14:12

SLaks