CS001errorFree tier

csharp-async-void

async void methods can't be awaited and crash the process on exception

Applies to: C#

Why this matters

async void methods are fire-and-forget. Exceptions thrown inside them can't be caught by the caller and will propagate to the synchronization context, which in many frameworks (including Unity and ASP.NET) crashes the process. Return Task instead so callers can await the method and handle errors. The only legitimate exception is event handlers with signature (object sender, EventArgs e).

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, CS001 includedstablestack explain CS001

False positive in your codebase? Suppress a single line with # noqa: CS001