Install Free
Visual Studio | Troubleshooting

Was this page helpful?

Troubleshooting

On this page

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 SonarLint 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.

How to get SonarLint logs

  • Select Show Logs from the SonarLint help menu: Extensions > SonarLint > Help > Show Logs

To conduct further troubleshooting, enable the Verbose output in the SonarLint Options, then repeat the action that caused the problem:

  • Navigate to Extensions > SonarLint > Options… > General and select the Verbose logging level.

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 SonarLint might not be able to find a matching file. 
  • The current bound project or solution does not match the SonarQube or SonarCloud 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

SonarLint 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.

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:
Type in the Visual Studio command window to create your reproducer file for SonarLint.

You can then view the location of the created reproducer file(s) in the SonarLint Output pane:

Reproducer file in SonarLint 4.21-4.26 

Where you can find your Reproducer file in SonarLint for Visual Studio v4.21-v4.26.

Reproducer files in SonarLint 4.27 

Where you can find your Reproducer file in SonarLint for Visual Studio v4.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.

© 2008-2024 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARLINT, SONARQUBE, SONARCLOUD, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License