Skip to content

Task completion and exception handling#53005

Draft
BillWagner wants to merge 1 commit intodotnet:mainfrom
BillWagner:async-aweigh-5
Draft

Task completion and exception handling#53005
BillWagner wants to merge 1 commit intodotnet:mainfrom
BillWagner:async-aweigh-5

Conversation

@BillWagner
Copy link
Copy Markdown
Member

@BillWagner BillWagner commented Apr 14, 2026

  1. Create task-exception-handling.md — from "Task exception handling in .NET 4.5." Covers GetAwaiter().GetResult() vs .Result exception propagation, AggregateException unwrapping, unobserved task exceptions, TaskScheduler.UnobservedTaskException. Update: modern .NET default behavior (unobserved exceptions no longer crash the process).
  2. Create complete-your-tasks.md — from "Don't forget to complete your tasks." Covers: always complete TaskCompletionSource on all paths, common bugs (forgetting SetException in catch, dropping TaskCompletionSource references during reset).
  3. Incorporate FAQ content about Task.Result vs GetAwaiter().GetResult().
  4. Add both to TOC.

Internal previews

📄 File 🔗 Preview link
docs/navigate/advanced-programming/toc.yml docs/navigate/advanced-programming/toc
docs/standard/asynchronous-programming-patterns/complete-your-tasks.md Complete your tasks
docs/standard/asynchronous-programming-patterns/task-exception-handling.md Task exception handling

1. Create `task-exception-handling.md` — from "Task exception handling in .NET 4.5." Covers `GetAwaiter().GetResult()` vs `.Result` exception propagation, `AggregateException` unwrapping, unobserved task exceptions, `TaskScheduler.UnobservedTaskException`. **Update:** modern .NET default behavior (unobserved exceptions no longer crash the process).
1. Create `complete-your-tasks.md` — from "Don't forget to complete your tasks." Covers: always complete `TaskCompletionSource` on all paths, common bugs (forgetting `SetException` in catch, dropping `TaskCompletionSource` references during reset).
1. Incorporate FAQ content about `Task.Result` vs `GetAwaiter().GetResult()`.
1. Add both to TOC.
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