This has always been a good practice to use ConfigureAwait(false)
whenever an async call is made. Then ASP.NET Core
came and it uses thread pool context instead of thread context and this became irrelevant. My understanding is that this is nothing to do with the fact it's .NET Core
, rather a new implementation of ASP.NET
managed to improve things and as a result we don't need to write this annoying ConfigureAwait(false)
any more. I didn't find any meaningful answer on whether I still need to use ConfigureAwait(false)
if I know that my code will only be hosted by a Service Fabric service and if this answer is any different if it's hosted on Stateful/Stateless service, implemented in .NET Framework
or .NET Core
, uses Azure Service Bus handlers or NServiceBus
handlers that may rely on SynchronizationCntext
.
Does Service Fabric use SynchronizationContext
and is it ok to ditch ConfigureAwait(false)
when code is hosted only in Service Fabric?