Cannot get plugin to work with Visual Studio

Please provide

  • Windows 11
  • Visual Studio 2026
  • SonarQube for Visual Studio plugin version: Latest
  • Programming language you’re coding in: V#
  • Is connected mode used: Yes
    • SonarQube Cloud, SonarQube Server, or SonarQube Community Build? (if one of the latter two, which version?):

When you compile the project, SonarQube is not outputting any warnings / message or errors in the Error list…which I am assuming is the point!

No warnings or messages provided in Error list

[ThreadId 113] [SLCore] [sonarlint > sonarlint-analysis-scheduler] Error executing sensor: 'SQVS-Roslyn'
[DEBUG] [ThreadId 113] [SLCore] [sonarlint > sonarlint-analysis-scheduler] java.lang.IllegalStateException: Response crashed due to: null
	at org.sonarsource.sonarlint.visualstudio.roslyn.http.HttpAnalysisRequestHandler.analyze(HttpAnalysisRequestHandler.java:70)
	at org.sonarsource.sonarlint.visualstudio.roslyn.RemoteAnalysisService.analyze(RemoteAnalysisService.java:55)
	at org.sonarsource.sonarlint.visualstudio.roslyn.SqvsRoslynSensor.analyze(SqvsRoslynSensor.java:158)
	at org.sonarsource.sonarlint.visualstudio.roslyn.SqvsRoslynSensor.execute(SqvsRoslynSensor.java:142)
	at org.sonarsource.sonarlint.core.analysis.container.analysis.sensor.SensorsExecutor.lambda$executeSensor$1(SensorsExecutor.java:102)
	at org.sonarsource.sonarlint.core.commons.tracing.Trace.startChild(Trace.java:63)
	at org.sonarsource.sonarlint.core.analysis.container.analysis.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:102)
	at org.sonarsource.sonarlint.core.analysis.container.analysis.sensor.SensorsExecutor.executeSensors(SensorsExecutor.java:93)
	at org.sonarsource.sonarlint.core.analysis.container.analysis.sensor.SensorsExecutor.execute(SensorsExecutor.java:80)
	at org.sonarsource.sonarlint.core.analysis.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:122)
	at org.sonarsource.sonarlint.core.commons.tracing.Step.executeTransaction(Step.java:42)
	at org.sonarsource.sonarlint.core.commons.tracing.Trace.lambda$startChildren$0(Trace.java:76)
	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source)
	at java.base/java.util.stream.ReferencePipeline$Head.forEach(Unknown Source)
	at org.sonarsource.sonarlint.core.commons.tracing.Trace.startChildren(Trace.java:76)
	at org.sonarsource.sonarlint.core.plugin.commons.container.SpringComponentContainer.startComponents(SpringComponentContainer.java:183)
	at org.sonarsource.sonarlint.core.plugin.commons.container.SpringComponentContainer.execute(SpringComponentContainer.java:164)
	at org.sonarsource.sonarlint.core.analysis.container.module.ModuleContainer.analyze(ModuleContainer.java:77)
	at org.sonarsource.sonarlint.core.analysis.command.AnalyzeCommand.doRunAnalysis(AnalyzeCommand.java:198)
	at org.sonarsource.sonarlint.core.analysis.command.AnalyzeCommand.doExecute(AnalyzeCommand.java:148)
	at org.sonarsource.sonarlint.core.analysis.command.AnalyzeCommand.execute(AnalyzeCommand.java:139)
	at org.sonarsource.sonarlint.core.analysis.command.AnalyzeCommand.lambda$execute$0(AnalyzeCommand.java:131)
	at org.sonarsource.sonarlint.core.commons.progress.TaskManager.runExistingTask(TaskManager.java:47)
	at org.sonarsource.sonarlint.core.analysis.command.AnalyzeCommand.execute(AnalyzeCommand.java:130)
	at org.sonarsource.sonarlint.core.analysis.AnalysisScheduler.executeQueuedCommands(AnalysisScheduler.java:71)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException
	... 26 more
Caused by: java.net.ConnectException
	at java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Unknown Source)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(Unknown Source)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.checkRetryConnect(Unknown Source)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$2(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.uniHandle(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	... 1 more
Caused by: java.nio.channels.ClosedChannelException
	at java.base/sun.nio.ch.SocketChannelImpl.ensureOpen(Unknown Source)
	at java.base/sun.nio.ch.SocketChannelImpl.beginConnect(Unknown Source)
	at java.base/sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
	at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$1(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	... 10 more

I have uninstalled the plugin, and reinstalled, now not getting the exception on Roslyn but it isn’t connecting. Log atttached:

Identified what I think is the key issue:

[DEBUG] [ThreadId 7] [Roslyn > Http Server] Staring http server for roslyn analysis...
[DEBUG] [ThreadId 7] [Roslyn > Http Server] Attempt 1 to start server on port 54255 failed due to The network location cannot be reached. For information about network troubleshooting, see Windows Help.

SonarQubeVisualStudio.log (291.0 KB)

Hi. Sorry for the delayed reply.

I looked at the logs and only saw attemts to analyze csproj files directly:

activeRules: [453 cpp, 27 css, 208 c, 52 Web, 337 csharpsquid, 3 text, 383 typescript, 59 tsql, 156 vbnet, 338 secrets, 375 javascript]
  inputFiles: [
    file:///C:/Users/matth/source/Workspaces/ForensicPortal/Version_2_0/InJenuity.Services.ForensicPortal.EfCore/InJenuity.Services.ForensicPortal.EfCore.csproj (UTF-8)
  ]

We run rules based on files, so you’ll need to open a .cs file to see some issues. One easy rule to trigger is adding a // todo comment, which should be highlighted by default.

If you’re looking to scan the whole project, this is not yet supported, but we’re looking into this.

BUT, these logs do in fact indicate there’s a problem - we can’t start our local analysis server for some reason:

[DEBUG] [ThreadId 80] [Roslyn > Http Server] Staring http server for roslyn analysis...
[DEBUG] [ThreadId 80] [Roslyn > Http Server] Attempt 1 to start server on port 51246 failed due to The network location cannot be reached. For information about network troubleshooting, see Windows Help.
[DEBUG] [ThreadId 80] [Roslyn > Http Server] Attempt 2 to start server on port 51247 failed due to The network location cannot be reached. For information about network troubleshooting, see Windows Help.
[DEBUG] [ThreadId 80] [Roslyn > Http Server] Attempt 3 to start server on port 51248 failed due to The network location cannot be reached. For information about network troubleshooting, see Windows Help.
[DEBUG] [ThreadId 80] [Roslyn > Http Server] Attempt 4 to start server on port 51249 failed due to The network location cannot be reached. For information about network troubleshooting, see Windows Help.
[DEBUG] [ThreadId 80] [Roslyn > Http Server] Attempt 5 to start server on port 51250 failed due to The network location cannot be reached. For information about network troubleshooting, see Windows Help.
[DEBUG] [ThreadId 80] [Roslyn > Http Server] Attempt 6 to start server on port 51251 failed due to The network location cannot be reached. For information about network troubleshooting, see Windows Help.
[DEBUG] [ThreadId 80] [Roslyn > Http Server] Attempt 7 to start server on port 51252 failed due to The network location cannot be reached. For information about network troubleshooting, see Windows Help.
[DEBUG] [ThreadId 80] [Roslyn > Http Server] Attempt 8 to start server on port 51253 failed due to The network location cannot be reached. For information about network troubleshooting, see Windows Help.
[DEBUG] [ThreadId 80] [Roslyn > Http Server] Attempt 9 to start server on port 51254 failed due to The network location cannot be reached. For information about network troubleshooting, see Windows Help.
[DEBUG] [ThreadId 80] [Roslyn > Http Server] Attempt 10 to start server on port 51255 failed due to The network location cannot be reached. For information about network troubleshooting, see Windows Help.
[DEBUG] [ThreadId 80] [Roslyn > Http Server] Failed to start server after 10 attempts.

Meaning, that even if you did open a .cs file and tried to analyze it, it would fail

Do you have any security policies or tools set up that could block the startup of a localhost http server?

Could you please install this build with additional logging and see if there’s more information in the logs? SLVS-2922 Improve roslyn server error logging · SonarSource/sonarlint-visualstudio@6b7771c · GitHub

I have wasted enough time with this plugin. I have removed it. I had wasted over 5 hours trying to get it to work in two vanilla environments.

Thanks for all your help in trying to resolve this. But see my last comment. I have uninstalled this tooling!