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

VSTHRD010 mis-fires when calling async method #226

Closed
AArnott opened this issue Mar 16, 2018 · 0 comments
Closed

VSTHRD010 mis-fires when calling async method #226

AArnott opened this issue Mar 16, 2018 · 0 comments
Assignees
Milestone

Comments

@AArnott
Copy link
Member

AArnott commented Mar 16, 2018

The VSTHRD010 analyzer will misfire on ShowToolWindow in the sample below when adding the call to the async method that switches itself to the main thread:

        private void ShowToolWindow(object sender, EventArgs e)
        {
            ThreadHelper.JoinableTaskFactory.RunAsync(async delegate
            {
                await FooAsync(); // this line is what adds the VSTHRD010 diagnostic
            });
        }
        
        private async Task FooAsync()
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
        }

This would be a regression from #220 which merged into master and even 9869911 which merged the same into v15.7

@AArnott AArnott added this to the v15.8 milestone Mar 16, 2018
@AArnott AArnott self-assigned this Mar 16, 2018
AArnott added a commit that referenced this issue Mar 17, 2018
AArnott added a commit that referenced this issue Mar 17, 2018
@AArnott AArnott modified the milestones: v15.8, v15.7 Mar 17, 2018
AArnott pushed a commit to AArnott/vs-threading that referenced this issue Oct 24, 2023
Bumps [xunit](https://github.com/xunit/xunit) from 2.5.2 to 2.5.3.
- [Commits](xunit/xunit@2.5.2...2.5.3)

---
updated-dependencies:
- dependency-name: xunit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
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