-
Notifications
You must be signed in to change notification settings - Fork 11
Avoid Async Void
Michael Damatov edited this page Dec 31, 2019
·
5 revisions
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 Task
forasync void
methods and local functions - Remove the
async
modifier for lambda and anonymous method expressions
- indirect event targets are not detected
- Command pattern with the async "Execute" method is not (yet) detected
💡 The analyzer can be deactivated in the ReSharper Options dialog.