sonarLint to exclude test project in visual studio

SLVS still does not use the SonarQubeExclude property, is there any other way we can force SonarLint to ignore certain projects within Visual Studio?
like that we can define something in Directory.build.props which can apply to specific projects to exclude SonarLint to run?

If you are using VS2019 you should be able to use the standard VS feature to turn off live analysis as described in the MS docs.

@duncanp Do we not have a way that I can use some settings and checked-in the code so that it should not come for anyone whoever is using the code , else it will be machine specific where I have ask all 50 developers to do in his machines.

The property RunAnalyzersDuringLiveAnalysis is an MSBuild property, so you can set it to false in your MSBuild project to turn off analysis for a specific project.

Note that the Run on live analysis and Run on build checkboxes in the UI also set the properties RunAnalyzersDuringLiveAnalysis and RunAnalyzersDuringBuild properties, but they are set in the per-user MyProject.csproj.user file which takes precedence over the settings in the MyProject.csproj file.

So setting the property in the main project file set the default behaviour, which individual users can override if they wish.

1 Like

grt … this is the solution. thanks for being so active on the community.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.