Redundant Captured Context - prodot/ReCommended-Extension GitHub Wiki
Analyzes whether adding .ConfigureAwait(false) is recommended.
Highlights the await keyword, if all following conditions are true:
- the awaited expression is the last expression in the method (local functions declared at the end of the method do not count as last) or the awaited expression is returned by the
returnstatement -
ConfigureAwait(...)is not applied to the awaited expression
- methods
- lambda expressions
- anonymous methods
- local functions
Tip
A context action is always available to add the ConfigureAwait(false) expression.
Note
The analyzer can be configured or deactivated in the ReSharper Options or Rider Settings dialog.