Skip to content

Async troubleshooting and pitfalls#52959

Draft
BillWagner wants to merge 1 commit intodotnet:mainfrom
BillWagner:anchors-aweigh-3
Draft

Async troubleshooting and pitfalls#52959
BillWagner wants to merge 1 commit intodotnet:mainfrom
BillWagner:anchors-aweigh-3

Conversation

@BillWagner
Copy link
Copy Markdown
Member

@BillWagner BillWagner commented Apr 9, 2026

Contributes to #17714

  1. Create common-async-bugs.md — from "Psychic Debugging of Async Methods." Covers the 4 most common bugs: method runs synchronously despite async, can't await void, deadlocks with SynchronizationContext, Task<Task> unwrapping. Also incorporate mentions of UI deadlocks (from "Await and UI and deadlocks") and static constructor deadlocks as warning notes.
  2. Create async-lambda-pitfalls.md — from "Potential pitfalls to avoid when passing around async lambdas." Covers: async lambdas assigned to Action delegates (becomes async void), Parallel.ForEach with async lambdas, Task.Factory.StartNew returning Task<Task>.
  3. Decompose relevant Async/Await FAQ content into both articles (FAQ answers about async void, Task.Wait vs await, the async keyword not forcing asynchrony).
  4. Add both to TOC. Consider grouping under a new "Best practices and troubleshooting" sub-section.

Internal previews

📄 File 🔗 Preview link
docs/navigate/advanced-programming/toc.yml docs/navigate/advanced-programming/toc
docs/standard/asynchronous-programming-patterns/async-lambda-pitfalls.md Async lambda pitfalls
docs/standard/asynchronous-programming-patterns/common-async-bugs.md "Common async/await bugs"

 Create `common-async-bugs.md` — from "Psychic Debugging of Async Methods." Covers the 4 most common bugs: method runs synchronously despite `async`, can't await `void`, deadlocks with `SynchronizationContext`, `Task<Task>` unwrapping. Also incorporate mentions of UI deadlocks (from "Await and UI and deadlocks") and static constructor deadlocks as warning notes.
1. Create `async-lambda-pitfalls.md` — from "Potential pitfalls to avoid when passing around async lambdas." Covers: async lambdas assigned to `Action` delegates (becomes async void), `Parallel.ForEach` with async lambdas, `Task.Factory.StartNew` returning `Task<Task>`.
1. Decompose relevant Async/Await FAQ content into both articles (FAQ answers about async void, `Task.Wait` vs `await`, the `async` keyword not forcing asynchrony).
1. Add both to TOC. Consider grouping under a new "Best practices and troubleshooting" sub-section.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant