Problem with sonar.exclusions

Hi @Haejoong_Lee, I managed to make it work. You need to specify module-based exclusions, such as this:

/d:2634460F-79A3-4EB3-AE3D-AA0F40A391FF.sonar.exclusions=Scripts/**/*

You just need to replace the GUID prefix above with the value of the element in the project you want to exclude (ProjectB in your example).

Alternative way to find the project GUID is to open .sonarqube\out\sonar-project.properties in your solution root after a successful analysis and look for lines like the following (the GUID prefix is the GUID you need):

2634460F-79A3-4EB3-AE3D-AA0F40A391FF.sonar.projectKey=cl3:2634460F-79A3-4EB3-AE3D-AA0F40A391FF
2634460F-79A3-4EB3-AE3D-AA0F40A391FF.sonar.projectName=ClassLibrary3
2634460F-79A3-4EB3-AE3D-AA0F40A391FF.sonar.projectBaseDir=c:\\Work\\ClassLibrary3\\ClassLibrary3
2634460F-79A3-4EB3-AE3D-AA0F40A391FF.sonar.sourceEncoding=utf-8
2634460F-79A3-4EB3-AE3D-AA0F40A391FF.sonar.sources=\
"c:\\Work\\ClassLibrary3\\ClassLibrary3\\Folder1\\Class1.cs",\
"c:\\Work\\ClassLibrary3\\ClassLibrary3\\Properties\\AssemblyInfo.cs"

Thanks @janos for the help!

2 Likes