Skip to content
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

Analyzer should report on IVsTask.Wait() inside an async method #287

Closed
AArnott opened this issue May 31, 2018 · 0 comments
Closed

Analyzer should report on IVsTask.Wait() inside an async method #287

AArnott opened this issue May 31, 2018 · 0 comments
Assignees

Comments

@AArnott
Copy link
Member

AArnott commented May 31, 2018

Async methods should not call IVsTask.Wait() or IVsTask.GetResult() but instead should simply await the IVsTask.

The VSTHRD002 or VSTHRD103 rules, or a new one perhaps, may be the best place to raise a warning when not awaiting an IVsTask from an async method.

Note it's OK to call these synchronously blocking methods from synchronous methods, since IVsTask mitigates its own deadlocks, similar to JoinableTask.Join().

@AArnott AArnott self-assigned this Jun 8, 2018
AArnott added a commit to AArnott/vs-threading that referenced this issue Jun 8, 2018
This also ensures that code fixes are only offered when the (extension) method that is prescribed as an async substitute is actually available so that the code fix does not lead to a compiler error.

Fixes microsoft#287
@AArnott AArnott closed this as completed Jun 13, 2018
AArnott pushed a commit that referenced this issue Oct 30, 2024
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.11.0 to 17.11.1.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md)
- [Commits](microsoft/vstest@v17.11.0...v17.11.1)

---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant