Details
-
Improvement
-
Resolution: Won't Fix
-
Minor
-
2.3.9
-
None
-
None
Description
We need to protect the SynchronizationContext when executing and waiting on async methods from a synchronous methods, however there are three different implementations so far:
1) Inline storing and overwriting the SynchronizationContext with a try / finally block
2) Wrapping the task.Wait in a SynchronizationContextExclusion
3) ConfigureAwait(false) or the extension method ContinueOnAnyContext
Ideally we should have a single way to manage the SynchronizationContext. Our preference is option 3) ConfigureAwait(false) as this is the most concise and was designed to fulfil the requirement of not requiring the original context to be reloaded onto the thread.