Skip to main content

Documentation Index

Fetch the complete documentation index at: https://ancplua.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Source: Al0057ToAl0060ThreadingAnalyzer.cs

Description

async void methods cannot be awaited, and any exceptions they throw will crash the process. Use async Task instead.

Bad Code

public async void SendNotification()
{
    await httpClient.PostAsync("/notify", content);
}

Good Code

public async Task SendNotification()
{
    await httpClient.PostAsync("/notify", content);
}

Properties

  • Category: Threading
  • Severity: Warning
  • Enabled by default: True
  • Code fix available: False

Configuration

dotnet_diagnostic.AL0057.severity = warning