> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-for-visual-studio/getting-started/requirements.md).

# Requirements

The software requirements to run SonarQube for Visual Studio in your IDE.

Each IDE extension of SonarQube for IDE has its own requirements to work properly with the most recent releases.

## Overview <a href="#overview" id="overview"></a>

SonarQube for Visual Studio is available for Visual Studio version [2026 & 2022](https://marketplace.visualstudio.com/items?itemName=SonarSource.SonarLintforVisualStudio2022).

{% hint style="warning" %}
SonarQube for Visual Studio is not supported on Visual Studio 2017 and 2019. Support for Visual Studio 2017 ended on March 1, 2022, and support for Visual Studio 2019 ended in April 2024. These extension packages will not be updated or rebuilt.

The Visual Studio 2019 package contains a build certificate that expired in 2023. Installation can fail, and the expired certificate is a security risk in environments with strict security requirements. Microsoft supports Visual Studio 2019 itself until April 2029, but that does not extend to this extension. Use SonarQube for Visual Studio with Visual Studio 2022 or 2026.
{% endhint %}

The only thing you need to install is the SonarQube for IDE VSIX available on the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=SonarSource.SonarLintforVisualStudio2022). Please see the [Installation](/sonarqube-for-visual-studio/getting-started/installation.md) for complete install instructions.

SonarQube for Visual Studio needs a Java Runtime (JRE) to operate and uses by default its own JRE.

If you want to use your own JRE:

1. The minimum JRE version requirement for SonarQube for Visual Studio version 10.0 is Java 21.
2. Specify the JRE path as follows:
   1. In Visual Studio, go to **Extensions** > **SonarQube** > **Options…** > **SonarQube** > **General** > **Java Home**.
   2. Enter the path to your JRE.
   3. Restart your IDE to apply the setting.

<div align="left" data-full-width="false"><figure><img src="https://1613591589-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5CSDwdOaYoOAGYNiRqgl%2Fuploads%2Fgit-blob-9e00b697b83e3770722b680063759a340c61b3a3%2F681c5a57fcca17a8fbfd38bd91cf1c9d966a9680.png?alt=media" alt="You can set your own JRE or use the JRE bundled with SonarQube for Visual Studio." width="375"><figcaption></figcaption></figure></div>

In versions prior to v4.34, additional steps were required for some languages. See below for more details.

## Supported IDEs <a href="#supported-ides" id="supported-ides"></a>

See the [Sonar website](https://www.sonarsource.com/products/sonarqube/ide/) for information about the currently supported IDEs, and also for details about which languages are supported in which IDEs.

## Unsupported IDEs <a href="#unsupported-ides" id="unsupported-ides"></a>

SonarQube for Visual Studio is not currently available for `Visual Studio for Mac`. However, it is still possible to use the Sonar C# and VB.NET analyzers in that IDE with a little manual configuration.

## Support for analyzing C# and VB.NET in other IDEs <a href="#support-for-analyzing-c-and-vbnet-in-other-ides" id="support-for-analyzing-c-and-vbnet-in-other-ides"></a>

`Visual Studio for Mac` supports the running of Roslyn analyzers that are shipped as NuGet packages. This includes Sonar C# and VB.NET rules.

The NuGet package id for the Sonar C# rules is [SonarAnalyzer.CSharp](https://www.nuget.org/packages/SonarAnalyzer.CSharp/). The NuGet package id for the Sonar VB.NET rules is [SonarAnalyzer.VisualBasic](https://www.nuget.org/packages/SonarAnalyzer.VisualBasic)

See below for information on setting up analysis in specific IDEs.

### Visual Studio for Mac <a href="#visual-studio-for-mac" id="visual-studio-for-mac"></a>

To configure a project to use the Sonar C# analyser, edit the project file to include the following XML:

```xml
  <!-- Import and configure the SonarC# analyzer -->
  <PropertyGroup>
    <SonarAnalyzerVersion>8.2.0.14119</SonarAnalyzerVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="SonarAnalyzer.CSharp" Version="$(SonarAnalyzerVersion)" />
    <Analyzer Include="$(NuGetPackageRoot)SonarAnalyzer.CSharp/$(SonarAnalyzerVersion)/analyzers/*.dll" Visible="false" />
  </ItemGroup>
```

Use `SonarAnalyzer.VisualBasic` instead of `SonarAnalyzer.CSharp` to configure the Sonar VB.NET analyzer.

Note that instead of editing every project file, you can create a single [Directory.Build.props](https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2019#directorybuildprops-and-directorybuildtargets) file at the solution level or repo level that will apply to all projects in the solution/repo.

It is possible to add references to NuGet packages through the UI but that will not add the necessary `Analyzer` entries in the project file; you must still add them manually by directly editing the project file. See this [StackOverflow post](https://stackoverflow.com/questions/49693416/visual-studio-for-mac-support-of-roslyn-analyzers) for more information.

## Language-specific requirements <a href="#language-specific-requirements" id="language-specific-requirements"></a>

<details>

<summary>JavaScript and TypeScript analysis</summary>

**NodeJS prerequisites for JS and TS**

Sonar’s JavaScript and TypeScript analyzers require specific Node.js versions to be installed on the machine. If no compatible version is found, the analysis will not be performed. See the table below for the minimal required Node.js version per SonarQube for Visual Studio version:

| SonarQube for Visual Studio | Minimal required Node.js version                                                                                                                                                                                                                                                |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| v10.8.0                     | <p>for Node v22, it must be at least 22.12.0.</p><p>for Node v24, it must be at least 24.0.0.</p>                                                                                                                                                                               |
| v9.1.0 - v10.7.0            | <p>for Node v20, it must be at least 20.12.0.</p><p>for Node v22, it must be at least 22.11.0.</p><p>for Node v24, it must be at least 24.0.0.</p>                                                                                                                              |
| v8.28.0 - v9.0.0            | <p>for Node v20, it must be at least 20.12.0.</p><p>for Node v22 the <a href="https://nodejs.org/en/about/previous-releases#release-schedule">Active LTS</a>, it must be at least 22.11.0, with acceptance of v23 and v24.</p>                                                  |
| v8.22.0                     | <p>for Node v18, it must be at least 18.20.0.</p><p>for Node v20, it must be at least 20.12.0.</p><p>for Node v22 the <a href="https://nodejs.org/en/about/previous-releases#release-schedule">Active LTS</a>, it must be at least 22.11.0, with acceptance of v23 and v24.</p> |
| v7.8                        | Node.js v18.17.1 and higher                                                                                                                                                                                                                                                     |
| v7.6                        | Node.js v16 and higher                                                                                                                                                                                                                                                          |
| v6.9                        | Node.js v14.17 and higher                                                                                                                                                                                                                                                       |
| v6.8                        | Node.js v12.22 and higher                                                                                                                                                                                                                                                       |
| v6.7 and earlier            | Node.js v10 and higher, excluding Node.js v11                                                                                                                                                                                                                                   |

In SonarQube for Visual Studio v9.1.0 and newer, other major versions, such as Node v23, are not supported.

**Auto-detection of compatible Node.js versions**

SonarQube for Visual Studio will attempt to locate a compatible Node.js version on the machine by searching on the %PATH%. If SonarQube for Visual Studio cannot find a compatible Node.js version, it will show a notification in a gold bar like the following:

<div align="left"><figure><img src="https://1613591589-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5CSDwdOaYoOAGYNiRqgl%2Fuploads%2Fgit-blob-3a41d228cac27581c9f3a98d39c42d58da445518%2F962444124f79e11f1daef20741980b986da9dffd.png?alt=media" alt="Your JS/TS analysis will fail if SonarQube for Visual Studio cannot find a supported version of Node.js on your computer." width="563"><figcaption></figcaption></figure></div>

The Output Window will contain additional information about the Node.js versions that were located:

<div align="left"><figure><img src="https://1613591589-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5CSDwdOaYoOAGYNiRqgl%2Fuploads%2Fgit-blob-bdbbab781ded81251dd8bb5b2eb65db7f83711df%2F7fa6015423f29cc0b8a879c91750221a56efc1a4.png?alt=media" alt="Your Output window will look similar if a compatible Node.js version is not found by SonarQube for Visual Studio" width="563"><figcaption></figcaption></figure></div>

**Manually specifying a custom location of Node.js installation**

You can also set the environment variable `SONAR_NODEJS_PATH` to specify a custom location. The value should be the full file path to the node executable e.g. `c:\custom\node.exe`. The environment variable takes precedence over the automatic detection. You will need to restart Visual Studio after setting or changing the environment variable.

**Installing Node.js**

If the machine does not have a compatible version of Node.js, you can manually install one. Node.js versions can be downloaded from the official website [nodejs.org](https://nodejs.org/en/download/). Both the 32-bit and 64-bit versions are supported. The simplest installation method on Windows is to use the appropriate `.msi`.

**Deprecation of older Node.js versions**

From time to time the Sonar JavaScript/TypeScript analyzer will increase the minimum required Node.js version as older versions go out of support. The dropping of support will be announced in advance in the Community Forum (e.g. [this post](https://community.sonarsource.com/t/node-js-v14-no-longer-supported-v16-stops-early-next-year/105428) regarding the deprecation of Node.js v16 and dropping of support for Node.js vs14).

This page will be updated as the minimum required Node.js version changes.

</details>

<details>

<summary>Analyzing CMake projects</summary>

This article is an overview of how to get started with analyzing CMake projects in Visual Studio 2022 and later versions, along with information about known issues. This feature is available starting with SonarQube for Visual Studio version 4.38.

If you need more help, please start a post on the [SonarQube for IDE Community - Visual Studio](https://community.sonarsource.com/c/sl/visual-studio/35) channel in the Sonar Community forum.

**Getting started - VS2022 and later**

1\) Open / create a new CMake project in Visual Studio

2\) Add the command `set(CMAKE_EXPORT_COMPILE_COMMANDS ON)` to the top-level `CMakeLists.txt` file:

<div align="left"><figure><img src="https://1613591589-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5CSDwdOaYoOAGYNiRqgl%2Fuploads%2Fgit-blob-5cef15fd1452197b7c2aa60ec4de7c9924a2df5e%2F84939ec08cc04d223b0001513aab2760d85e0345.png?alt=media" alt="Add a command to your CMakeLists.txt file to generate the compilation database." width="563"><figcaption></figcaption></figure></div>

3\) Save the file.

4\) Check that VS has generated the compilation database.

Source and header files will now be analyzed on opening/saving. The SonarQube for Visual Studio *Output Window* will contain more information about the progress of the analysis.

**CMake - known limitations**

**Environment variable overrides in CMakeSettings.json are not supported**

SonarQube for Visual Studio will not process environment variable overrides in *CMakeSettings.json* files.

The SonarQube for Visual Studio analysis results may be incorrect if the overridden environment variables affect the CMake compilation e.g. changing the paths that are searched for header files.

**CMake presets are not currently supported by SonarQube for Visual Studio**

See the [Microsoft documentation](https://devblogs.microsoft.com/cppblog/cmake-presets-integration-in-visual-studio-and-visual-studio-code/) for more information about support for CMake presets in Visual Studio.

**Only the Ninja generator is supported**

SonarQube for Visual Studio uses the generated compilation database (`compile_commands.json`) to fetch the compiler options to use during analysis. The `Ninja` generator creates a compilation database, and the other Visual Studio generators do not. Visual Studio uses the `Ninja` generator by default. For more information, see the [Microsoft documentation on the CMake generator](https://learn.microsoft.com/en-us/cpp/build/customize-cmake-settings?view=msvc-170#cmake-generator). You can also configure Visual Studio to use the `Ninja` generator by providing an appropriate `CMakeSettings.json` file, for example:

```json
{
  "configurations": [
    {
      ... 
      "name": "x64-Release",
      "generator": "Ninja",
      ...
      "buildRoot": "${projectDir}\\out\\build\\${name}\\",
      "installRoot": "${projectDir}\\out\\install\\${name}",
      ...
    }
  ]
}
```

</details>

### C and C++ analysis-specific requirements <a href="#cfamily-analysis-specific-requirements" id="cfamily-analysis-specific-requirements"></a>

**Downloading the CFamily analyzer**

The CFamily analyzer is not included with the release files to optimize download times. After you install SonarQube for IDE, a download of the CFamily analyzer starts automatically therefore, an internet connection is required.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-for-visual-studio/getting-started/requirements.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
