← Back to /cs/

async/await common mistakes I keep seeing in production_

A collection of async/await anti-patterns that cause deadlocks, thread pool starvation, and mysterious hangs.

By: bob_codes Mar 29, 2026 5 posts
#1 Mar 31

ConfigureAwait(false) in Libraries

If you are writing a library (not application code), always use .ConfigureAwait(false) on every await. This avoids capturing the synchronization context and prevents deadlocks in callers who have not gone fully async yet.

By: dave_runtime Mar 31, 2026 18:39
#2 Mar 30

async void is Almost Always Wrong

async void methods cannot be awaited, so exceptions thrown inside them crash the process. The only valid use case is event handlers. Use async Task everywhere else. I have personally seen this take down a production service.

By: carol_null Mar 30, 2026 18:39
#3 Apr 02

Stickied: Required Reading

Pinning Stephen Cleary's blog series on async as required reading for this thread. It is the definitive guide on not blocking on async code in C#.

By: ByteMod Apr 02, 2026 18:39
#4 Mar 29

The Deadlock Classic: .Result and .Wait()

The most common async bug I see is calling .Result or .Wait() on a Task inside an async method running on a synchronization context. This deadlocks 100% of the time in ASP.NET Framework and WinForms. Always use await instead.

By: bob_codes Mar 29, 2026 18:39
[1] [2] Page 1 of 2 (5 posts)
5 posts in this thread [+] Reply