Shubh Rocks Goel
Shubh Rocks Goel

Reputation: 631

SonarQube - Excluding files and folders [Entire .Net Project (csproj)]

enter image description hereI am trying to exclude some folders from Sonar scan through VSTS build. We have used Sonar plugin for MSBuild.

If I use the exclusion pattern as **/*.cs then it is excluding all the .cs files. My goal is to exclude whole folder from scan. I have tried the following patterns but none of them seems to work

**/folder/*
**/folder/*.cs
**/folder/**
**/folder/**/*
**/folder/**/*.cs
folder/*.cs
folder/**/*.cs
folder/**/*
folder/**
folder/*

Please help in getting the correct pattern.

I want to exclude This Issue project from the scan.

Upvotes: 1

Views: 6717

Answers (1)

duncanp
duncanp

Reputation: 1580

You can exclude an entire C# project by setting the MSBuild property SonarQubeExclude to true in the project file. See this post: How to exclude/ignore referenced project(s) analysis from SoanrQube

Upvotes: 2

Related Questions