SQVS-Roslyn sensor crashes with KeyNotFoundException on every analysis of a VB.NET file

Operating system: Windows 11 (x64)
Visual Studio version: Visual Studio 2026 (18.0) — instance 18.0_64D338B5
SonarQube for Visual Studio plugin version: sonaranalyzer-vbnet / sonaranalyzer-cs v10.4.1.110446
Programming language you’re coding in: VB.NET (InletValveController.vb files)
Is connected mode used: Yes
SonarQube Cloud, SonarQube Server, or SonarQube Community Build? SonarQube Server exact version unknown

Description of the problem:
Every time SonarQube for Visual Studio triggers an analysis on a VB.NET file, the SQVS-Roslyn sensor immediately fails with an unhandled KeyNotFoundException inside RoslynProjectCompilationProvider.GetProjectCompilationAsync. The local Roslyn HTTP server at localhost returns HTTP 500, the sensor is aborted, and the final analysis result is 0 issues / 0 hotspots even though the local KNOWN_FINDINGS database contains 2 tracked issues for the same file (rule vbnet:S1125, introduced the same day).
Full stack trace from the Roslyn HTTP server:

Error handling request: The given key was not present in the dictionary.

at System.ThrowHelper.ThrowKeyNotFoundException()
 at System.Collections.Generic.Dictionary2.get_Item(TKey key) 
at SonarLint.VisualStudio.RoslynAnalyzerServer.Analysis.RoslynProjectCompilationProvider
.d__2.MoveNext()
at SonarLint.VisualStudio.RoslynAnalyzerServer.Analysis.SequentialRoslynAnalysisEngine
.d__5.MoveNext()
at SonarLint.VisualStudio.RoslynAnalyzerServer.RoslynAnalysisService
.d__8.MoveNext()
at SonarLint.VisualStudio.RoslynAnalyzerServer.Http.RoslynAnalysisHttpServer
.d__19.MoveNext()

Open a solution containing VB.NET projects in Visual Studio 2026 with SonarQube extension installed in Connected Mode.

  1. Open any InletValveController.vb source file.
  2. Observe SonarQube triggering analysis automatically (or trigger manually).
  3. Check SonarQube output logs SQVS-Roslyn fails with HTTP 500 on every run.

Additional observations:
• The error is persistent and reproducible across at least 3 consecutive analysis runs within the same session, including re-analyses triggered by LinkedFileAnalyzer.
• The activeRules configuration passed to the analysis engine lists no VB.NET rules ([448 cpp, 208 c, 49 Web, 337 csharpsquid, 1 text, 59 tsql, 121 secrets]), despite the file being correctly detected as VBNET. This may be a separate but related configuration issue.
• sonar.vbnet.roslyn.ignoreIssues=false is set, confirming Roslyn issues are not intentionally suppressed.
• The 2 known issues (vbnet:S1125 on lines 46 and 54) have SERVER_KEY = null, meaning they have never been synced to the server — likely because this failure prevents any VB.NET issues from ever being confirmed and reported upstream.
• Restarting Visual Studio temporarily restores the compilation provider state, but the error recurs.

Ps. I kinda had to use the AI to interpret the logs properly so please excuse the robotic tone.
Much love,
Ladbon

Hi Ladbon,

Welcome to the community and thanks for this thorough report!

Can you give me the version of SonarQube for Visual Studio? I think the version number you provided must be for an underlying component, since the current version of SonarQube for Visual Studio is 9.8.1.

 
Thx,
Ann

Thanks. Good luck troubleshooting.

1 Like

Hi,

Thanks for the version number. I’ve flagged this for the team.

 
Ann

Hi. Could you please provide full logs? The KeyNotFoundException is most likely a symptom, not the cause of the problem