The SonarQube MSBuild integration failed

Hello, I have a problem in the Run Code Analysis task of azure…
Sometimes our build fails(random error) and appear the next message:

Generating SonarQube project properties file to E:\Agent01_work\50.sonarqube\out\sonar-project.properties
##[error]The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:

  1. The project has not been built - the project must be built in between the begin and end steps
  2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0 and 15.0 are supported
  3. The begin, build and end steps have not all been launched from the same folder
  4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)

##[debug]Processed: ##vso[task.logissue type=error;]The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.%0D%0APossible causes:%0D%0A 1. The project has not been built - the project must be built in between the begin and end steps%0D%0A 2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0 and 15.0 are supported%0D%0A 3. The begin, build and end steps have not all been launched from the same folder%0D%0A 4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)

Versions used {
Run Code Analysis azure task 4
SonarScanner for MSBuild 4.6.2
MSBuild 16
SonarQube 7.9.1
}

Error{
Random error (most of the time it works). We don’t find any coincidence
}
Steps to reproduce{
Run our build and in the step “Run Code Analysis” sometimes fails.
}

Attachments:
sonarqube-support-info-F863D1E3-1f0c1fc6b0cfc80-2019-9-17-12-17.txt (28.8 KB)

Thanks in advance.

Hi,

Could you please tell us a bit more about your context, such as :

  • The type and the language of the project you are trying to analyze
  • The target .NET Framework version (or .NET core where appropriate)

Thank you.

Hi! Our project is developed in C#.
We are using .NET Framework 4.7.0

I attach the logs of the task “Run Code Analysis” of Azure… This is the logs of a failed build.
RunCodeAnalysisLog.txt (13.5 KB)

Thanks!

Thanks,

So apparently the targets are not correctly executed.

Could you please send me the logs of the Prepapre analysis configuration and MSBuild as well ?

I can send you a PM if you don’t want to send them here.

And yes, better in PM…
Thanks!

Any update on this? I am following @tomas.martin work and need some more info on this…

I am also facing a similar issue in AZURE CI BUILD while executing “Run code analysis” task.

But for me, it’s random, upon executing the build second/third time this issue won’t appear.

It’s difficult to predict the root cause. Pls, help me out. Happening randomly on different Builds on different projects.