6

I'm trying to analyze a VS2017 solution with Sonarqube. I've installed the server on a VM with Windows 2016. I've created a batch file in the root of the solution with the command suggested by the Sonarqube server after creating the project:

SonarScanner.MSBuild.exe begin /k:"MyProject" /d:sonar.host.url="http://sonarqubeserver:9002" /d:sonar.login="KeyProvidedByServer"

"%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MsBuild.exe" 

D:\Source\Repos\Project\MyProject.sln /t:Rebuild
    SonarScanner.MSBuild.exe end /d:sonar.login="KeyProvidedByServer"

When I launch the batch file from command prompt with administrative privileges the first and second command run coorectly but the third ands up with many lines like

WARNING: File 'D:\Source\Repos\Project\MyProject\class.cs' is not located under the root directory 'D:\Source\Repos\Project\.sonarqube\out' and will not be analyzed.

and a final message

File was referenced by the following projects: 'D:\Source\Repos\Project\Project\MyProject.csproj'.

No analysable projects were found. SonarQube analysis will not be performed. Check the build summary report for details.

Writing processing summary to

D:\Source\Repos\Project\.sonarqube\out\ProjectInfo.log Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.

12:13:35.099 Creating a summary markdown file...

12:13:35.103 Post-processing failed. Exit code: 1

What's wrong with this configuration?

Edika
  • 303
  • 5
  • 16

0 Answers0