Why is this an issue?

An async method with a void return type does not follow the task asynchronous programming (TAP) model since the return type should be Task or Task<TResult>

Doing so prevents control over the asynchronous execution, such as:

Exceptions

How to fix it

Update the return type of the method from void to Task.

Code examples

Noncompliant code example

private async void ThrowExceptionAsync() // Noncompliant: async method return type is 'void'
{
  throw new InvalidOperationException();
}

public void Method()
{
  try
  {
    ThrowExceptionAsync();
  }
  catch (Exception)
  {
    // The exception is never caught here
    throw;
  }
}

Compliant solution

private async Task ThrowExceptionAsync() // Compliant: async method return type is 'Task'
{
  throw new InvalidOperationException();
}

public void Method()
{
  try
  {
    await ThrowExceptionAsync();
  }
  catch (Exception)
  {
    // The exception is caught here
    throw;
  }
}

Resources

Documentation