Wrong option passed to TaskCompletionSource (CA2247)
Key dotnet.async.taskcompletionsource-options · Severity error · Category async
Microsoft analyzer CA2247. Flags a TaskContinuationOptions value passed to the TaskCompletionSource constructor, which expects TaskCreationOptions. It compiles and means something else entirely.
Incorrect
Section titled “Incorrect”var tcs = new TaskCompletionSource(TaskContinuationOptions.RunContinuationsAsynchronously);Correct
Section titled “Correct”var tcs = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);