-
Notifications
You must be signed in to change notification settings - Fork 12
Redundant Captured Context
Michael Damatov edited this page Sep 10, 2025
·
3 revisions
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
return
statement -
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.