> ## Documentation Index
> Fetch the complete documentation index at: https://ancplua.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AL0057 - Avoid async void methods

> async void methods cannot be awaited and exceptions cannot be caught

Source: [Al0057ToAl0060ThreadingAnalyzer.cs](https://github.com/ANcpLua/ANcpLua.Analyzers/blob/main/src/ANcpLua.Analyzers/Analyzers/Al0057ToAl0060ThreadingAnalyzer.cs)

## Description

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

## Bad Code

```csharp theme={null}
public async void SendNotification()
{
    await httpClient.PostAsync("/notify", content);
}
```

## Good Code

```csharp theme={null}
public async Task SendNotification()
{
    await httpClient.PostAsync("/notify", content);
}
```

## Properties

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

## Configuration

```editorconfig theme={null}
dotnet_diagnostic.AL0057.severity = warning
```
