When running VS as Elevated sonarQube can't connect

Please provide

  • Operating system: Windows 11
  • Visual Studio version: 17.14.5
  • SonarQube for Visual Studio plugin version: 8.20.0.13314
  • Programming language you’re coding in: C# / Typescript
  • Is connected mode used:
    • SonarQube Server: Data Center Edition v2025.1 (102418)

And a thorough description of the problem / question:

At my work place we can no longer open VisualStudio as admin and now have to use the elevated access:
image

But now sonarqube wont connect up meaning connected mode no longer works.
Steps:

  • Create a new connection
  • Select SonarQube server and add the URL
  • Click generate token
  • Opens in browser fine
  • Click the authorise button,
  • Connection Failed error

Also tried steps above but creating the token myself and copy and pasting it in but same issue.

Let me know if there is anything i can get to help as shame to lose this because the login flow does not work. VS recently did updates to their login flow to support elevated access as its becoming more common.

Do you get similar logs to this?IllegalStateException: Visual Studio - When Binding Connection/Project

No these are the logs:

`[DEBUG] [ThreadId 36] [SLCore] [org.sonar.plugins.javascript.bridge.BridgeServerImpl > pool-3-thread-1] Pinging the bridge server

[ThreadId 1] Bringing IDE to front…

[DEBUG] [ThreadId 1] SetForegroundWindow call failed. Last error code: 0

[ThreadId 1] Failed to write credentials, Win32ErrorCode: 1312. See Tutorial - Debug system error codes - Win32 apps | Microsoft Learn for more information.

[ThreadId 1] Failed adding server connection: Failed to write credentials

[DEBUG] [ThreadId 151] [SLCore] [org.sonar.plugins.javascript.bridge.BridgeServerImpl > pool-3-thread-1] Pinging the bridge server`

Hi @rybowdenAccess

Can you check if you have this option enabled?

If not, then is your windows account using cloud-based identity provider (AzureAD/EntraID)? We’ve seen reports of users not being able to access the local Credentials Store when running SQVS with elevated/admin privileges. (cc @Farah ) We plan to address this issue in the future

Correct it is set to disabled:

Correct as well, user account is AzureAD/EntraID from central and we lost admin rights so now having to use elevated permissions for VS now.

Unfortunately we were not able to find a quick fix to our integration with Credential Store/Manager and we need to explore other options, so I can’t promise a concrete timeline yet.

For now, the only workaround is to run VS with normal privileges, but I understand that this might not be possible for you. Since we started to receive more reports for this problem, it will probably be bumped in the priority.

Hi @rybowdenAccess

We’re trying to investigate this issue and have set up an EntraID environment where we ran VS as admin, however we couldn’t reproduce the same problem as you faced. However, I noticed that you run it ‘with elevated access’ - can you confirm that this is what’s used to configure those elevated privileges?


Yes i believe the thing you posted EPM is what we have because once we click that we they get this popup which is to say why we are doing that and that has EPM in the top bar:

Hi.

We have the same issue with not being able to create connection to our SonarQube server when using SonarQube extension in Visual Studio running with EPM (Endpoint Privileged Management) option Run with elevated access.

After supplying server URL and authentication token we receive error Creating a connection failed. SQ Extension in VS logs this in Output window:

Failed to write credentials, Win32ErrorCode: 1312. See https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes for more information.

Failed adding server connection: Failed to write credentials

We are able to create connection to SQ server from the extension both when running Visual Studio as standard user and regular user with administrator privileges on the workstation.

Could you please review this issue since it’s blocking us from implementing EPM on our system? SonarQube extension is important part of our daily workflows.

Thank you!

Hi @nandjelkovic

If you absolutely can’t run VS as a non-elevated/non-admin user, then we will require some help from you in order to test solutions to this problem.

Unfortunately, the Credential Store APIs from MS that we use completely break if you run the process with EPM elevated access. There is no documentation on this topic whatsoever and so far we’ve been exploring solutions blindly, as setting up a test environment with EPM was unsuccessful for us.

If you’re willing to run some custom builds we provide to test how the extension behaves on your side & validate if alternative solutions work for you, then we can restart our investigation, subject to planning & product priorities. Otherwise, without your cooperation, it will be very difficult for us to fix this problem.

Hi Georgii.

We are willing to test custom builds if there is a chance to overcome these issues with EPM elevated Visual Studio instances not able to connect to SonarQube server. The only concern would be additional data being sent outside our system since we have strict security procedures and standards we need to comply with.

Please share in short form what would procedure consist of and after our security review we could begin with the process.

Thank you!

We don’t plan to have any data exchange, apart from extension logs if there are any errors. We’re mostly interested in trying things and seeing if they work and if they provide a good user experience. I will bring this topic up in the next planning meeting and will get back to you.

I am also willing to help where I can on this :slight_smile:

We appreciate your patience. While our team is currently focused on other priorities, we’ve planned to include this work in our next development iteration, which is scheduled to begin in two weeks.

I will follow up closer to that date with information regarding testing and experimental builds.

Hi @rybowdenAccess & @nandjelkovic Could you please install the test build (you can download it from here SLVS-2383 Testing different credential store implementations · SonarSource/sonarlint-visualstudio@8fd09b1 · GitHub ) ? In the options, please enable verbose logging. Then, below the logging verbosity there should be a new setting to change credential store type. Please try both of the new ones separately (save the logs, restart when changing the credential store type) and provide feedback (along with the logs). If you’re not comfortable doing it publicly, you can send a DM to me on this forum.

Good news is managed to get it installed, a bit of a pain when you running as elevated.

Sadly ran out of time to test today for you. But do you have a rough idea where the log files will go so i can get them for you when i done the testing?

The logs should be in the same place Troubleshooting | Visual Studio | Sonar Documentation

Hi Georgii. Thank you for your effort on this. I am currently busy with finishing some projects in the company and I will attend this during next week. Thanks again!

@georgii.borovinskikh I have sent you a DM with details and log files

Hi Ryan. Could you please advise how you managed to install custom vsix installer and make it available when running VS with elevated access? When I install it with double click and VS installer it only shows with my standard account.

Thank you!