How to specify sonar.project.properties file in dotnet scanner command

I am using dotnet-sonarscanner --version 4.8.0 and Sonarqube version 7.94 LTS. Can you please suggest how can I use sonar.project.properties file in dotnet scanner command.

Command:
sh “”" dotnet sonarscanner begin -k:“sonarqubeABC” “”"
sh “dotnet build {workspace}/{solutionfile}”
sh “”" dotnet sonarscanner end -d:sonar.login=“secrect-text” “”"

Hi,

Welcome to the community!

The docs should help.

 
Ann

The “SonarScanner for .NET” page does not refer to a sonar-project.properties file. There is some documentation about this file in the base SonarScanner page.

Is a sonar-project.properties file not needed/used when using the SonarScanner for .NET? Could I set up a sonar-project.properties file and configure the SonarScanner for .NET to consume it?

1 Like

Hi @ahaleiii,

Correct. It is not needed. The values read from that file in other contexts are read from the project in a .NET context.

No. If you really need to override / add to the properties the .NET analysis picks up automatically, the command line is easiest.

 
HTH,
Ann

1 Like