ReSharper 2026.1 Help

Code inspection: Redundant 'WithCancellation()' invocation

This inspection reports a .WithCancellation(...) call when the same cancellation token has already been applied earlier in the async-enumerable chain. The extra call is redundant and does not change how cancellation works.

Example

var items = source .WithCancellation(token) .ConfigureAwait(true) .WithCancellation(token);
var items = source .WithCancellation(token) .ConfigureAwait(true);

Quick-fix

The quick-fix removes the redundant WithCancellation() call.

13 April 2026