Search code examples
c#jenkinssonarqubewindows-server-2012-r2sonarqube-msbuild-runner

SonarQube can't complete the post-build step


I got a Jenkins Server set up on Windows 2012 R2. These are my build settings:

enter image description here

Underneath you see the error. It should be said that the pre-build step runs successfully:

[Test CSharp Build Job] $ ...\Jenkins\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\MSBuild_2.0\MSBuild.SonarQube.Runner.exe end
SonarQube Scanner for MSBuild 2.0
Default properties file was found at ...\Documents\Jenkins\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\MSBuild_2.0\SonarQube.Analysis.xml
Loading analysis properties from ...\Documents\Jenkins\.jenkins\tools\hudson.plugins.sonar.MsBuildSQRunnerInstallation\MSBuild_2.0\SonarQube.Analysis.xml
Post-processing started.
SonarQube Scanner for MSBuild End Step 1.1
No ProjectInfo.xml files were found. Possible causes: 
1. The project has not been built - the end step was called right after the begin step, without a build step in between 
2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 12.0 upwards are supported
3. The build step has been launched from a different working folder
Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
11:18:18.015  Creating a summary markdown file...
Post-processing failed. Exit code: 1
ERROR: Execution of SonarQube Scanner for MSBuild failed (exit code 1)

So in my Jenkins Configuration I have this:

enter image description here

Am I missing something to make this work?


Solution

  • Okay I figured it out

    I forgot to add a /t:rebuild in between building with MSBuild and running the End Analysis command.