Redundant Captured Context - prodot/ReCommended-Extension GitHub Wiki

Analyzes whether adding .ConfigureAwait(false) is recommended.

Analyzer

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 return statement
  • ConfigureAwait(...) is not applied to the awaited expression

Applies to

  • 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.

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