Troubleshooting
Knowing where to begin looking for information is the first step to reaching out for help. Many answers to commonly found problems can be found on the SonarQube for IDE channel of the Sonar Community Forum. See below for the basic steps to access the SonarLint logs when the analysis results are not what you expected.
Before posting to the Community, make sure that you have your logs ready by following the instructions below.
How to get the SonarQube for Visual Studio logs
- Select Show Logs from the SonarLint help menu: Extensions > SonarQube for Visual Studio > Help > Show Logs
To dig deeper, enable the Verbose output in the SonarLint Options, then repeat the action that caused the problem:
- Navigate to Extensions > SonarQube for Visual Studio > Options… > General and set your Logging level to Verbose.
Troubleshooting connected mode setup
No matching project found
No matching project is found because:
- It's best if you already have the project open in your IDE, otherwise SonarQube for Visual Studio might not be able to find a matching file.
- The current bound project or solution does not match the SonarQube Server or SonarQube Cloud project or solution. Please check your binding configuration.
If these solutions don't help, follow these instructions to manually configure the project binding.
No matching issue found
SonarQube for Visual Studio can't find your issue because:
- You might not be on the same branch.
- The issue was fixed, or the source code may be different from the analyzed version.
Updating your credentials
Unfortunately, you cannot update your SonarQube Server or SonarQube Cloud credentials in SonarQube for Visual Studio but the feature is in the development team’s backlog. Please see the Updating your credentials article on the Connection setup page.
Language-specific examples
C or C++ Analysis
Troubleshooting C or C++ Analysis
Starting with version 4.21, it is possible to create a reproducer file for C and C++ analysis. A reproducer file contains diagnostic information to help the developers at SonarSource investigate problems that occur during C or C++ analysis.
Note: Starting with version 4.27, a second reproducer file is created with additional debug information.
If you encounter a problem with C or C++ analysis, please contact us in the Sonar Community forum and include the reproducer file(s).
Creating a reproducer file for the Active Document
To create a reproducer:
- open the C or C++ file that is not being analysed correctly
- open Visual Studio's Command Window, found under View > Other Windows > Command Window.
- type in the command window
Analyze.SonarLint.CFamily.CreateReproducer
:
You can then view the location of the created reproducer file(s) in the SonarQube for Visual Studio Output pane:
Reproducer file in SonarLint 4.21-4.26
Reproducer files in SonarLint 4.27
Notes:
- The reproducer file(s) are regenerated each time the command is invoked. Invoking the command will overwrite the previous reproducer file(s).
- Running the reproducer will only produce the reproducer file(s). It will not report any issues for the active C or C++ file.
Was this page helpful?