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
- Use
async Taskforasync voidmethods and local functions - Remove the
asyncmodifier 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.