3 ms·
I know this is a breaking change, but I sure wish async methods called ConfigureAwait(false) by default. That's a majority of use cases in my experience. I've c
by jackcosgrove 10y ago
I know this is a breaking change, but I sure wish async methods called ConfigureAwait(false) by default. That's a majority of use cases in my experience. I've come across .NET libraries with asynchronous methods that deadlock because some internal asynchronous call does not invoke ConfigureAwait(false).
- achr2 10y agoI definitely agree. Not using '.ConfigrueAwait(false)' is the exception rather than the rule. That said, I use an extension method '.NoSync()' to replace it which at least is more succinct and explicit. There are a few other async/await constructs that are glaringly missing in .NET. My most useful is a function 'await TaskEx.EnsureNoContext()' which conditionally yields to the threadpool if not already on it. With this function I rarely need to use 'Task.Run'.