ConfigureAwait(false) relevant in ASP.NET Core?

前端 未结 2 1560
臣服心动
臣服心动 2020-11-28 05:28

I stumbled on an issue (https://github.com/HTBox/allReady/issues/1313) at GitHub where they discussed about taking the ConfigureAwait(false) out of the code, cl

相关标签:
2条回答
  • 2020-11-28 05:59

    What about this?

    At this moment (Feb-2020) Developers on MS Blog recommends use ConfigureAwait(false) in order to Improving performance, Avoiding deadlocks. https://devblogs.microsoft.com/dotnet/configureawait-faq/

    I’ve heard ConfigureAwait(false) is no longer necessary in .NET Core. True? False. It’s needed when running on .NET Core for exactly the same reasons it’s needed when running on .NET Framework. Nothing’s changed in that regard.

    0 讨论(0)
  • 2020-11-28 06:01

    ConfigureAwait only has effects on code running in the context of a SynchronizationContext which ASP.NET Core doesn't have (ASP.NET "Legacy" does).

    General purpose code should still use it because it might be running with a SynchronizationContext.

    ASP.NET Core SynchronizationContext

    0 讨论(0)
提交回复
热议问题