I’m scanning a .net core project with the SonarScanner for MSBuild on a TeamCity build server. It’s an official plugin developed by Jetbrains. It is running SonarQube Scanner 4.2.0.1873.
Scanning has been working fine for quite long time with no hickups until recently it started to fail for many projects with the following error in the log:
ERROR: Error during SonarQube Scanner execution
ERROR: File src/Customer.Abstractions/Enums/OwnerType.cs can't be indexed twice. Please check that inclusion/exclusion patterns produce disjoint sets for main and test files*
Begin analysis command is the following:
MSBuild.SonarQube.Runner.exe "/d:project.home=." "/d:sonar.host.url=[https://sonarqube.company.net](https://sonarqube.company.net/)" "/k:Customer_project" "/n:Customer" "/v:209" "/d:sonar.login=????" /d:sonar.cs.opencover.reportsPaths=**\**\coverage.opencover.xml /d:sonar.exclusions=**\libs\**\* /d:sonar.sources=src /d:sonar.qualitygate.wait=true begin
I’m setting custom sonar.exclusions, sonar.cs.opencover.reportsPaths parameter values, so that’s controlled. But I’m suspicious about the sonar.sources parameter which seems to be automatically set and I read in some community threads that it’s advised not to use sources and exclusions parameters at the same time.
So any ideas, suggestions how to fix or workaround this issue?