One of the enclosing scopes holds a cancellation token. However, an invoked method does not receive this token although it or one of its overloads accept a cancellation token. Cancellation tokens are meaningless if not used accordingly.
Pass the cancellation token of the enclosing scope to the invoked method. If the invoked method must not be canceled (e.g., for logging a failure), pass CancellationToken.None
instead to explicitly state the intention.
# A white-space separated list of methods to exclude when searching for method invocations that miss the cancellation token
# Format: <type-specifier>:<method1>,<method2>
dotnet_diagnostic.PH_P007.exclusions = System.Threading.Tasks.Task:Run