Installation
On this page
For the most part, SonarLint can be installed directly from your IDE's Marketplace. Offline installations are also possible and previous versions are always available if needed.
SonarLint is available as an extension for Visual Studio version 2022.
Since March 1, 2022, SonarLint for Visual Studio 2017 has not been supported. After SonarLint for Visual Studio 8.0, no new features will be added to SonarLint for Visual Studio 2019. This means that there will not be any new updates to these versions.
Critical bugs will be addressed in SonarLint for Visual Studio 2019 for a period of 6 months after April, 2024. We encourage users to take advantage of the latest enhancements by updating to SonarLint for Visual Studio 2022.
Instructions
To install SonarLint from within Visual Studio:
- From Visual Studio, go to Extensions > Manage Extensions and search SonarLint for Visual Studio.
- Select SonarLint for Visual Studio and click Download.
The extension will be installed after all instances of Visual Studio have been closed.
SonarLint needs a Java Runtime (JRE) to operate and will use its own JRE if you don't provide one.
- To specify a JRE, go to Extensions > SonarLint > Options… > SonarLint > General > Java Home, add the path to your JRE, and restart your IDE to apply the setting.
First taste of SonarLint
Now that you have SonarLint installed, open or create a new project containing source files in a programming language SonarLint can analyze out of the box. See the Rules page for languages that work with your IDE.
For example in C#, you can copy-paste this code snippet into your file and have a look at what SonarLint returns in the Error List:
Was this page helpful?