Unable to connect to SonarQube from Visual Studio 2017

I am trying to make a new connection to SonarQube server through SonarLint.
Regardless of using the username/password combination or token, it doesn’t seem like it’s connecting, I am unsure why it cannot connect.

The connection doesn’t show registered in the Team Explorer > SonarQube > Connections

If you could point me to the log file where it records the connection attempts and failure that would be a great start.

Any other useful pointers to use the tool as I have never used before.

Version of SQ: * Enterprise Edition* Version 7.9.1 (build 27448)
Version of SL:
OS: Windows 10
Code language to Scan: C#

Hi @cvaland - welcome to the community.

This wiki page shows what you should expect to see when connecting to a SonarQube server in Visual Studio.

The log output is recorded in the SonarLint pane of the normal VS Output window.
You can increase the verbosity of the logged output from the SonarLint options pane (Tools, Options, SonarLint`).

Thank you @duncanp
I have managed to get the output, it isn’t showing any errors and apparently connecting successfully. I have also run a scan and can see a lot of warnings that are displayed in the Error List.
But for some reason, the connection is still not showing in the plugin:


Please find below, the logs from the output window:

Saved settings to “C:\Users\USERNAME\AppData\Roaming\SonarLint for Visual Studio\settings.json”.
File changed: C:\Users\USERNAME\AppData\Roaming\SonarLint for Visual Studio\settings.json. Change type: Created
Loaded settings from “C:\Users\USERNAME\AppData\Roaming\SonarLint for Visual Studio\settings.json”.
User settings have changed. Open documents will be re-analysed.
Starting job: “re-analyzing 0 document(s)…”. Time: 09:03:35
Finished job “re-analyzing 0 document(s)…” started at 09:03:35. Elapsed time: 3ms
Connecting to SonarQube server: https://SERVERURL
Connecting to SonarQube server: Validating credentials
Connecting to SonarQube server: Detecting server plugins
Discovered a supported plugin: Plugin: ‘SonarC#’, Language(s): ‘C#’, Installed version: ‘7.16.0’, Minimum version: ‘5.0’
Discovered a supported plugin: Plugin: ‘SonarVB’, Language(s): ‘VB.NET’, Installed version: ‘7.16.0’, Minimum version: ‘3.0’
Discovered a supported plugin: Plugin: ‘SonarCFamily’, Language(s): ‘C++, C’, Installed version: ‘6.3.0’, Minimum version: ‘6.0’
Connecting to SonarQube server: Retrieving projects
Connecting to SonarQube server: Succeeded
Connecting to SonarQube server: Downloading server settings.

@cvaland the log output shows you’ve connected to the server. However, you don’t appear to have selected the Sonar project to bind to i.e. you still need to do step 5.

This topic was automatically closed after 11 days. New replies are no longer allowed.