Set ConfigureAwait(false) for entire project/dll
async-await, c#
Solution
No, there is no option for this. The Microsoft team did consider a compiler setting or something for that behavior, but ended up rejecting it.
The main reason is that it's quite difficult to tell how the code behaves without knowing how the compiler switch is set.
Problem
According to an article in MSDN Magazine, it is the best practice to "Use `ConfigureAwait(false)` when you can." Furthermore it states, "If you can use `ConfigureAwait` at some point within a method, then I recommend you use it for every await in that method after that point." Stephen Cleary, the author of that article, states on his blog that "In your 'library' async methods, use ConfigureAwait(false) wherever possible [emphasis added]." Given that most or all of my `await` statements in a library project that is meant to be widely used should have `.ConfigureAwait(false)` is it possible to do something/change a setting to make it so that the default behavior of await within my project/dll is to not continue on the a captured context? That is, so that I could omit all the calls to `.ConfigureAwait(false)` and instead add `.ConfigureAwait(``true``)` only when I need the context to be preserved.