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

error VSTHRD010 errors are not displayed in the error list (17.4.0 RTM) #65304

Closed
dpugh opened this issue Nov 9, 2022 · 6 comments
Closed

error VSTHRD010 errors are not displayed in the error list (17.4.0 RTM) #65304

dpugh opened this issue Nov 9, 2022 · 6 comments
Assignees
Labels

Comments

@dpugh
Copy link

dpugh commented Nov 9, 2022

Version Used:
17.4.0 RTM

Steps to Reproduce:

  1. Add a ThreadHelper.ThrowIfNotOnUIThread(); to some method that might be called from a background thread.
  2. Build
  3. Expect to see a VSTHRD010: Accessing "Microsoft... error in the error list.
  4. Don't (though I do see it in the build output.

Expected Behavior:
Error shows up in both error list and build output.

Actual Behavior:
Only shows up in build output.

11>StandaloneModelLoader -> B:\dd\IntelliCode-VS3\bin\Debug\StandaloneModelLoader\StandaloneModelLoader.exe
9>RefactoringsTest -> B:\dd\IntelliCode-VS3\bin\Debug\RefactoringsTest\RefactoringsTest.dll
2>InlineSuggestions -> B:\dd\IntelliCode-VS3\bin\Debug\InlineSuggestions\Microsoft.VisualStudio.Internal.InlineSuggestions.vsix
13>B:\dd\IntelliCode-VS3\src\VSIX\IntelliCode.VSIX\SuggestionService\Implementation\SuggestionBroker.cs(865,22,865,37): error VSTHRD010: Accessing "Microsoft.VisualStudio.IntelliCode.SuggestionService.Implementation.SuggestionBroker.UpdateScopeTags" should only be done on the main thread. Call Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread() first.
13>Done building project "IntelliCode.VSIX_gn0nj2rv_wpftmp.csproj" -- FAILED.
13>Done building project "IntelliCode.VSIX.csproj" -- FAILED.
14>------ Rebuild All started: Project: IntelliCode.VsPackage.UnitTests, Configuration: Debug Any CPU ------
12>ModelServiceTest -> B:\dd\IntelliCode-VS3\bin\Debug\ModelServiceTest\ModelServiceTest.dll
12>Done building project "ModelServiceTest.csproj".
10>ModelInference -> B:\dd\IntelliCode-VS3\bin\Debug\ModelInference\ModelInference.dll
10>Done building project "ModelInference.csproj".
15

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 9, 2022
@CyrusNajmabadi
Copy link
Member

@mavasani soemthing you've looked at in diagnostics recently?

@Youssef1313
Copy link
Member

One thing to note is that VSTHRD010 is a compilation-end analyzer.

https://github.com/microsoft/vs-threading/blob/a83e88dac6a824cd80e8ad6024b29a473ca2e270/src/Microsoft.VisualStudio.Threading.Analyzers.CSharp/VSTHRD010MainThreadUsageAnalyzer.cs#L154

@CyrusNajmabadi
Copy link
Member

Good point @Youssef1313 . However, i would still expect them to show up in the build-errors-list. @mavasani how should this work?

@Youssef1313
Copy link
Member

Good point @Youssef1313 . However, i would still expect them to show up in the build-errors-list. @mavasani how should this work?

Yeah I'd expect it to work. I pointed that out in case the issue is specific to compilation end.

@mavasani
Copy link
Contributor

mavasani commented Nov 10, 2022

@Youssef1313 It seems the descriptor doesn’t have the CompilationEnd tag:

public const string CompilationEnd = nameof(CompilationEnd);

we use this tag to identify build only diagnostics for live-build de-duping. We should do couple of things here:

  1. Fix the descriptor above to add this tag. Filed Add WellKnownDiagnosticTags.CompilationEnd for compilation end diagnostic descriptors microsoft/vs-threading#1113
  2. Add a new RSxxxx diagnostic to our MS.CA.Analyzers package to flag any descriptor without this custom tag being used to report a diagnostic on CompilationEndContext. Filed Add RSxxxx diagnostic for compilation end diagnostic descriptors without CompilationEnd custom tag roslyn-analyzers#6282

@mavasani
Copy link
Contributor

Closing this issue as relevant issues have been filed in the respective repos - see #65304 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants