-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSTHRD103 fired on Task.WaitAll #951
Comments
I can't repro this. No warnings appear. What you say the analyzer is suggesting doesn't make any sense. I don't think the code fix would know how to add Having one of our analyzers recommend Task.WhenAll over Task.WaitAll, particularly while inside an async method, would be by design. |
My apologies. I mixed it up. Original
Result
Btw if the method is a simple void, it almost gets it right:
Changed
Just the |
Thanks for the better code snippets. I still cannot repro though. What version of the microsoft.visualstudio.threading.analyzers package are you using? Consider sending a zip of your minimal repro project if that's easier. |
Here you go. On an additional example I found this |
Perfect. These all repro for me. I'll keep this around and turn each of these into unit tests in the repo to fix them up. |
ping |
Bug description
VSTHRD103 complains on:
Task.WaitAll(taskLArray, CancellationToken.None);
suggesting
Task.await(taskList.ToArray(), CancellationToken.None);
Repro steps
Task.WaitAll(someTaskArray, CancellationToken.None);
Expected behavior
do nothing
Actual behavior
Corrects to
Task.await(someTaskArray, CancellationToken.None);
The text was updated successfully, but these errors were encountered: