Avoid Async Void - prodot/ReCommended-Extension GitHub Wiki

Show a warning when async void is used inappropriately. The following table summarizes the analysis rules:

where usages found usages not found
public surface methods show warning show warning if not annotated with [UsedImplicitly]
non-public surface methods show warning if any non-direct event handler usage exists
inherited methods* show warning show warning

* overriding or implementing interface member

Quick Fixes

  • Use async Task for async void methods and local functions
  • Remove the async modifier for lambda and anonymous method expressions

Important

Known Limitations

  • indirect event targets are not detected
  • Command pattern with the async "Execute" method is not (yet) detected

Note

The analyzer can be configured or deactivated in the ReSharper Options or Rider Settings dialog.

⚠️ **GitHub.com Fallback** ⚠️