SonarScanner with MSBuild and properties file

I want to plug my build pipeline to my SonarQube server (Version For that, I’m using SonarScanner for AzureDevOps on a TFS server 2018 with the “Integrate with MSBuild” option.

My project is composed by an ASP.Net application (cs, cshtml), JavaScript/TypeScript files, CSS, HTML and XML.
I want add properties for exclude somes files from scanning. I doing it by a propertie file store in a subdirectory. I can’t move easily this file to the Build root folder.
So, I add a parameter in “additional Properties” like this :


But Sonar analyse my excluded files. Do I use it correctly ? Is there a way to use property file with Integrate With Ms Build Option ?

Hi @Cedric and welcome to the community !

Exclusions and all settings can be passed directly in the additional properties. The Scanner for MSBuild generates it’s own so it will not take the file you provide in account.


Hi @mickaelcaro, thank you for your answer.
Ok, so it’s simply impossible to merge my two files. I’m following the wrong path.
If I want have shared parameters in all my Builds definitions (GatedCheckin, Integration Build, etc.), I can do it only with TFS global variables. Is there another solution to do that ?