SonarQube 7.2 - .Net projects exclude folders


(Praveen Nayak) #1

SonarQube Version 7.2.1, SonarScanner for MSBuild 4.3.1, TFS 2015.2 VNext Build.

I am trying to exclude a few common folders (cs projects are in these folders) from analysis, code coverage, so I started with code coverage first. I go to Analysis Scope for the SonarQube project and want to exclude *ServiceHost,

so I try these under coverage exclusions.

Either of these do not exclude the folder from code coverage and the code coverage results shows project in this folder as not covered reducing the coverage. Can you please advise what I am doing wrong? I have attached the end analysis build log for your reference.

On a related note, is it possible to change the project setting and apply it on the latest run? That way, when experimenting with the wildcards, we don’t have to wait for a full build run.

6_End SonarQube Analysis.txt (61.1 KB)

(Colin Mueller) #2


To make it a little clearer, I’ll include the exclusion from your logs with al the wildcards escaped so that Discourse formatting doesn’t confuse things.


While theoretically this excludes all subdirectories, it does not actually exclude the files within those directories. Something like…


Should get you headed in the right direction.

On your related note – no, changes to exclusions (and most if not all other project configuration) currently always requires a new analysis.


(Praveen Nayak) #3

Hi Colin,

Thanks for the info, tried
but it does not change the code coverage. Argon.Services.ServiceHost files still show up in code coverage and skew the results. Anything else you see I am missing? Attached the
log file.


6_End SonarQube Analysis.txt (61.2 KB)