We are facing problem while analyzing c# project that how to set environmental variable and how to execute sonar runner command?
Asked
Active
Viewed 292 times
-2
-
please let me know if anyone having idea about same?? – Yogesh Khurpe Dec 15 '17 at 06:47
-
1Please, give more details about your problem. Did you read the documentation of Sonar Scanner for MSBuild? https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild – Val Dec 15 '17 at 08:08
-
From the root folder of the project how we can analyze, execute the following commands: SonarQube.Scanner.MSBuild.exe begin /k:"org.sonarqube:sonarqube-scanner-msbuild" /n:"Project Name" /v:"1.0" MSBuild.exe /t:Rebuild SonarQube.Scanner.MSBuild.exe end – Yogesh Khurpe Dec 15 '17 at 10:30
-
Now C# Project is anlayzed successfully but even if threre is issue then on sonar dashboard it shows zero issues? why? – Yogesh Khurpe Dec 16 '17 at 06:10
1 Answers
0
In order to run the Scanner for MSBuild from the root dir of your project you need to do one of the following:
add the folder where the Scanner for MSBuild is installed to the system PATH variable. You could follow the instructions in this answer (see "Old Method"): https://superuser.com/questions/949560/how-do-i-set-system-environment-variables-in-windows-10
type the full name of the executables, for example if you installed Scanner for MSBuild into
c:\tools\sonar-scanner-msbuild.4.0
the commands could be:
c:\tools\sonar-scanner-msbuild.4.0\sonarqube.scanner.msbuild.exe ...
msbuild ...
c:\tools\sonar-scanner-msbuild.4.0\sonarqube.scanner.msbuild.exe ...

Val
- 1,920
- 1
- 11
- 14