Task.Yield() in library needs ConfigureWait(false)
问题 It's recommended that one use ConfigureAwait(false) whenever when you can, especially in libraries because it can help avoid deadlocks and improve performance. I have written a library that makes heavy use of async (accesses web services for a DB). The users of the library were getting a deadlock and after much painful debugging and tinkering I tracked it down to the single use of await Task.Yield() . Everywhere else that I have an await, I use .ConfigureAwait(false) , however that is not