Reputation: 157
I'm using SonarQube 7.0 and SonarQube Scanner for MSBuild 4.0.2.892 and attempting to follow these instructions to scan my .NET application on Windows (ASP.NET Core). The three commands below are part of the instructions:
C:\SonarQube\Scanner\SonarQube.Scanner.MSBuild.exe begin /k:"org.sonarqube:sonarqube-scanner-msbuild" /n:"TradingPlatform" /v:"1.0"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" /t:Rebuild
C:\SonarQube\Scanner\SonarQube.Scanner.MSBuild.exe end
However, while pre-processing succeeds on the fist command, and the build completes on the second command, the third command always fails as shown below:
====
SonarQube Scanner for MSBuild 4.0.2 Default properties file was found at C:\SonarQube\Scanner\SonarQube.Analysis.xml
Loading analysis properties from C:\SonarQube\Scanner\SonarQube.Analysis.xml
Post-processing started.
The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
Exit Code 1.
====
Does anyone have any idea why it's failing? Cause 1 can't be the case as I'm building the project in step 2. Cause 2 seems very unlikely (but not impossible) as I'm using MSBuild 15. Cause 3 also can't be the case as I'm running all three commands from the same location
Upvotes: 1
Views: 5766
Reputation: 2080
Other possible reasons are:
<ProjectGuid>XXXXX</ProjectGuid>
element in the first PropertyGroup
in your csproj, where XXXXX is a newly generated Guid.If this does not help, add /d:sonar.verbose=true
on the begin
command of the scanner and save all logs into a file. Zip the logs and the .sonarqube
folder from your build workspace and upload them here: https://www.dropbox.com/request/CszJAO1ZNXFVl1gwo5hA
Upvotes: 2