Unable to use connected mode after update to version 11.0.0

Please provide

  • Operating system: Windows 11
  • Visual Studio version: VS 2026 Professional version 18.10.3
  • SonarQube for Visual Studio plugin version: 11.0.0.17354
  • Programming language you’re coding in: C#
  • Is connected mode used: To SonarQube Cloud

And a thorough description of the problem / question:

Visual Studio prompted me to update the extension. Before the update everything - including connected mode - worked fine. Right after the update to version 11.0.0.17354 Visual Studio showed a bar with this text:

The token used for the server connection "<my org> is invalid, please update the credentials.

When I try to enter my access token (which I know is correct and still valid) then I get this error:

The credentials of the connection “<my org>” were not updated: Binding could not be established because Server Connection’s Credentials could not be found. Please check the SonarQube for Visual Studio logs for mor details..

The SonarQube output window shows this:

Summary
Initializing the telemetry package...
Finished initializing the telemetry package...
[Solution Tracking] Initialized with solution solution_name
[Focus on New Code] Focus on New Code definition not available: Configuration scope not initialized
Initializing the notifications package...
Connected: checking for notifications
Finished initializing the notifications package
Initializing the daemon package...
SonarQube for VisualStudio version: 11.0.0.17354
[Connection Migration] The connections.json file already exists. Migrating connections from existing bindings was not performed
Created directory: C:\Users\user_name\AppData\Roaming\SonarLint for Visual Studio\SolutionSettings\solution_name
[Plugin Statuses] Service Provider is unavailable
Current VS version:
    Visual Studio Professional 2026
    18.10.12224.181
    18.10.3
[SLCoreHandler] Creating SLCore instance
[SLCoreHandler] Starting SLCore instance
Loaded settings from "C:\Users\user_name\AppData\Roaming\SonarLint for Visual Studio\settings.json".
Settings file does not exist at "C:\Users\user_name\AppData\Roaming\SonarLint for Visual Studio\SolutionSettings\solution_name\settings.json".
[NodeJSLocator] Checking environment variable SONAR_NODEJS_PATH
[NodeJsLocator] Environment variable is not set
[SLCore > Configuration Scope] Declared Configuration Scope solution_name
[SLCore] Using H2 2.4.240 which is newer than the version Flyway has been verified with. The latest verified version of H2 is 2.3.232.
[SLCore > Configuration Scope] Updated files system parameters for Configuration Scope solution_name: Root=D:\, Commands Directory=D:\Source\repository_name
[solution_name] File 'C:\Program Files (x86)\WiX Toolset v3.14\bin\\WixNetFxExtension.dll' can't be relativized against root 'D:\' and is skipped
[solution_name] File 'C:\Program Files (x86)\WiX Toolset v3.14\bin\\WixUIExtension.dll' can't be relativized against root 'D:\' and is skipped
[solution_name] File 'C:\Program Files (x86)\WiX Toolset v3.14\bin\\WixUtilExtension.dll' can't be relativized against root 'D:\' and is skipped
[solution_name] File 'C:\Users\user_name\AppData\Local\Temp\TFSTemp\vctmp1240_472854.SomeClass.f53ae08e.cs' can't be relativized against root 'D:\' and is skipped
[solution_name] File 'C:\Users\user_name\AppData\Local\Temp\TFSTemp\vctmp14784_122528.SomeClass.22d8e8d7.cs' can't be relativized against root 'D:\' and is skipped
[solution_name] File 'C:\Users\user_name\AppData\Local\Temp\TFSTemp\vctmp18256_46760.SomeClass.ba478c0b.cs' can't be relativized against root 'D:\' and is skipped
[solution_name] File 'C:\Users\user_name\AppData\Local\Temp\TFSTemp\vctmp20668_664451.SomeClass.ba478c0b.cs' can't be relativized against root 'D:\' and is skipped
[solution_name] File 'C:\Users\user_name\AppData\Local\Temp\TFSTemp\vctmp24380_104778.SomeClass.1c7ddf85.cs' can't be relativized against root 'D:\' and is skipped
[solution_name] File 'C:\Users\user_name\AppData\Local\Temp\TFSTemp\vctmp34700_480754.SomeClass.66633aea.cs' can't be relativized against root 'D:\' and is skipped
[solution_name] File 'C:\Users\user_name\AppData\Local\Temp\CopilotBaseline\45d682ae\~SomeClass.cs' can't be relativized against root 'D:\' and is skipped
[solution_name] File 'C:\Users\user_name\AppData\Local\Temp\CopilotBaseline\f949b6eb\~SomeClass.cs' can't be relativized against root 'D:\' and is skipped
[SLCore] No credentials for connection https://sonarcloud.io/organizations/organization_name
Finished initializing the daemon package.
[ConnectedMode/BranchMapping] Matching Sonar server branch: develop
[SLCore > Configuration Scope] Updated analysis readiness for Configuration Scope solution_name: True
Updated analysis readiness: True
[SLCore > Configuration Scope] Updated Sonar branch for Configuration Scope solution_name: develop
Initializing the SonarQube for Visual Studio package...
Finishing initializing the SonarQube for Visual Studio package
[ConnectedMode] Initializing package...
[ConnectedMode] Package initialized
[Taint] Initializing taint issues synchronization package...
[Server Issue Sync > Taint] Fetched 0 taint vulnerabilities.
[Server Issue Sync > Dependency Risks] Fetched 0 dependency risks.
[Taint] Finished initializing taint issues synchronization package.
[Connected Mode > Binding > Manual] The credentials for the connection https://sonarcloud.io/organizations/organization_name could not be found
[SLCore] No credentials for connection https://sonarcloud.io/organizations/organization_name

I’ve even created a new access token and the same problem still happens.

If I open a solution which does not contain a JSON file with binding information, then the error is different. At first it looks like I could update the access token - a success message is shown. But if I later try to select the connection in the bind dialogue, then an error is shown again:

“The token for the selected connection is invalid.”

I can continue this loop forever. Edit connection, enter token, success massage, select connection, error message.

I’ve now downgraded to version 10.9.0.17293 and the first start of VS again showed the "The token used for the server connection “<my org> is invalid” bar. But updating the token worked and now connected mode is working again.

+1

\[Connected Mode > Shared Binding\] The shared binding configuration file was not found and will not be used. Probed path: not found
\[SLCore\] No credentials for connection https://sonarcloud.io/organizations/elpedison-github
\[Connected Mode > Shared Binding\] The shared binding configuration file was not found and will not be used. Probed path: not found
\[Connected Mode\] System.ArgumentException: Unexpected ICredentialsModel argument
at SonarLint.VisualStudio.ConnectedMode.SlCoreConnectionAdapter.MapCredentials(IConnectionCredentials credentials)
at SonarLint.VisualStudio.ConnectedMode.SlCoreConnectionAdapter.GetTransientConnectionDto(ServerConnection serverConnection)
at SonarLint.VisualStudio.ConnectedMode.SlCoreConnectionAdapter.GetAllProjectsAsync(...)
at SonarLint.VisualStudio.ConnectedMode.UI.ProjectSelection.ProjectSelectionViewModel.AdapterGetAllProjectsAsync(...)
at SonarLint.VisualStudio.ConnectedMode.UI.ProgressReporterViewModel.ExecuteTaskWithProgressAsync(...)

Hey @Manuel.P and @nick-vas, thanks for reporting. I’m going to flag this for the team to have a look, this does sound like a bug indeed.

By the way @Manuel.P and @nick-vas, while we wait for the team to look into this, perhaps you could try using this alternative credentials store as a workaround. Please let me know if this does the trick!

@Manuel.P @nick-vas Hi. Have you had the chance to check if it works with the other credentials store?

In any case, I’ve created a custom build with additional logging to help trace the problem as I can’t reproduce this locally. Please install it and share the verbose(debug) logs.

VSIX can be found in build artifacts

+1 also experiencing this after updating t the latest version

@georgii.borovinskikh @andres I’ve installed the custom test version.

This error is logged when I open the solution with the saved credentials from the old extension version:

[DEBUG] [ThreadId 81] [Credentials Loader] [AggregatingSolutionBindingCredentialsLoader > Default > Load] System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at SonarLint.VisualStudio.ConnectedMode.Persistence.AggregatingSolutionBindingCredentialsLoader.<>c__DisplayClass5_0.<Load>b__0() in C:\a\sonarlint-visualstudio\sonarlint-visualstudio\src\ConnectedMode\Persistence\AggregatingSolutionBindingCredentialsLoader.cs:line 59
   at SonarLint.VisualStudio.ConnectedMode.Persistence.AggregatingSolutionBindingCredentialsLoader.SafeExecute(Action act, String caller) in C:\a\sonarlint-visualstudio\sonarlint-visualstudio\src\ConnectedMode\Persistence\AggregatingSolutionBindingCredentialsLoader.cs:line 83
[DEBUG] [ThreadId 81] [Credentials Loader] [AggregatingSolutionBindingCredentialsLoader] [CREDTRACE] AggregatingSolutionBindingCredentialsLoader.Load swallowed exception: KeyNotFoundException: The given key was not present in the dictionary.
[DEBUG] [ThreadId 81] [Credentials Loader] [AggregatingSolutionBindingCredentialsLoader] [CREDTRACE] AggregatingSolutionBindingCredentialsLoader.Load for https://sonarcloud.io/organizations/organization_name via Default: resultType=null
[DEBUG] [ThreadId 81] [CREDTRACE] Loaded credentials for connection https://sonarcloud.io/organizations/organization_name [type: null]
[DEBUG] [ThreadId 81] [ActiveSolutionBoundTracker] Initialization complete

A very similar error is logged when I try to update the access token:

[DEBUG] [ThreadId 1] [CREDTRACE] Saving credentials for connection https://sonarcloud.io/organizations/organization_name [type: TokenAuthCredentials]
[DEBUG] [ThreadId 1] [Credentials Loader] [AggregatingSolutionBindingCredentialsLoader] [CREDTRACE] AggregatingSolutionBindingCredentialsLoader.Save for https://sonarcloud.io/organizations/organization_name via Default [type: TokenAuthCredentials]
[DEBUG] [ThreadId 1] [Credentials Loader] [AggregatingSolutionBindingCredentialsLoader > Default > Save] Executing Credential Operation
[DEBUG] [ThreadId 1] [Credentials Loader] [AggregatingSolutionBindingCredentialsLoader > Default > Save] System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at SonarLint.VisualStudio.ConnectedMode.Persistence.AggregatingSolutionBindingCredentialsLoader.<>c__DisplayClass6_0.<Save>b__0() in C:\a\sonarlint-visualstudio\sonarlint-visualstudio\src\ConnectedMode\Persistence\AggregatingSolutionBindingCredentialsLoader.cs:line 73
   at SonarLint.VisualStudio.ConnectedMode.Persistence.AggregatingSolutionBindingCredentialsLoader.SafeExecute(Action act, String caller) in C:\a\sonarlint-visualstudio\sonarlint-visualstudio\src\ConnectedMode\Persistence\AggregatingSolutionBindingCredentialsLoader.cs:line 83
[DEBUG] [ThreadId 1] [Credentials Loader] [AggregatingSolutionBindingCredentialsLoader] [CREDTRACE] AggregatingSolutionBindingCredentialsLoader.Save swallowed exception: KeyNotFoundException: The given key was not present in the dictionary.

I’ve also tried the DPAPI credential storage and it looks like that indeed fixes the error (after updating/entering the access token once). But it’s still weird that the default credentials storage is broken for me (and others) in version 11.

Indeed, it looks like the default credential store instance can’t be created at all.

Do you, by any chance, have multiple copies of our extension in C:\Users\*\AppData\Local\Microsoft\VisualStudio\18*\Extensions?

No, there is only one: C:\Users\my_name\AppData\Local\Microsoft\VisualStudio\18.0_3912dc1b\Extensions\viusyjuy.bvz

There is one other folder in Extension but it is from a different extension.

I also have a VisualStudio\18.0_17ca88ae folder, but it doesn’t contain an Extensions folder.

Very odd. I’m preparing a build with more logs. I suspect the library we use for the default credentials store may not be loading for some reason. Would really appreciate if you could give it a try.

Good news. Suddenly, I’m able to reproduce the problem locally. I will contact you once I have more to share.

@Manuel.P Could you try this build? SLVS-3080 Add temporary CREDTRACE debug logging to trace credentials read/write · SonarSource/sonarlint-visualstudio@45617e8 · GitHub

@georgii.borovinskikh Looks like it’s fixed. This build works fine with the default credential storage.

Good to know, thanks.

The fix should make it into the next release. Though, you can still use the other credentials store. Overall, it has less issues.

The fix is released on the marketplace, version 11.1.