SonarAnalyzer.CSharp scanning NuGets

Not sure if this is the right category or even the right forum, so apologies in advance if not.

I am using SonarAnalyzer.CSharp, 9.15.081779 although I have this issue with previous versions too.
I am using it in a .NET8 solution, using VS22 17.8.2

I configure it through a Directory.Builds.prop file where I define the analyzer, where I treat warnings as errors, and I don’t want to change that.

I get some SonarQube errors derived from the fact that the analyzer is scanning code from a Nuget dependency added in one of my test projects, (specifically Microsoft.NET.Test.Sdk 17.6.3. I have a S1118, S3903 and S1186 errors., on Autogenerated files.

Is it possible to tell the Analyzer not to analyze any of the NuGet packages code?

Hey @sergioet

Am I correct in understanding that you’re using the analyzer directly without using SonarLint for VisualStudio?