We use the SonarQube Scanner for MSBuild (1.1.0.0) and have a solution containing several projects.
In the root folder of the solution is SonarQube.Analysis.xml , which we supply to cli scanners.
<SonarQubeAnalysisProperties xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sonarsource.com/msbuild/integration/2015/1"> <Property Name="sonar.cs.opencover.reportsPaths">output/nunit-coverage.xml</Property> <Property Name="sonar.cs.nunit.reportsPaths">output/nunit-result.xml</Property> <Property Name="sonar.exclusions">Project1/Migrations/*</Property> <Property Name="sonar.coverage.exclusions">Project1/Migrations/*</Property> </SonarQubeAnalysisProperties>
Now the problem: Project1/Migrations/* does not seem to be ruled out, because during the scan, Base dir set to .../Project1 . The same thing happens for all other projects in the solution. As a result .../Project1/Project1/Migrations/* is an unknown path.
So, what is the recommended way to exclude a whole directory from the scope and analysis of the source code when using MSBuild Scanner?
source share