Make Sonarlint connection persistent

  • Operating system:
    Windows 11
  • SonarLint plugin version:
    6.16.0.69538
  • Programming language you’re coding in:
    C#
  • Is connected mode used:
    • Connected to SonarCloud or SonarQube (and which version):
      SonarQube Developer Edition Version 10.0 (build 68432)

And a thorough description of the problem / question:
Everytime we open a project we get the message:

SonarQube request failed: Invalid credentials
Checking for unbound projects.
Error loading server settings. Analysis settings from the server (e.g. inclusions/exclusions) will not be applied in the IDE. Error: No file was found under ‘…Components.sonarlint\sonar.settings.json’
Some binding configuration is missing. Please rebind the solution.

Is there an example of sonar.settings.json to fix this?

@HeSitates

SonarLint can’t authenticate when connecting to the server so it can’t pull down the necessary configuration data.

There are a couple of ways you could fix this:

  1. create a new dummy VS solution and bind that to the same Sonar server project. That should cause SLVS to re-prompt for credentials which it will then store in the Windows Credential Manager.

  2. directly update the user name / password in the Windows Credential Manager. If the user has bound to a Sonar project before then there a Generic Credential in the form “SonarLint.VisuualStudio.Integartion:[Server URL]” e.g.

FYI we have a ticket to track this issue - #SLVS-2845