Error : The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects

##[section]Starting: Run Code Analysis

Task : Run Code Analysis
Description : Run scanner and upload the results to the SonarCloud server.
Version : 1.6.2
Author : sonarsource
Help : This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.

More Information

[command]D:\a_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.6.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe end
SonarScanner for MSBuild 4.6
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
10:46:30.598 Fetching code coverage report information from TFS…
10:46:30.598 Attempting to locate a test results (.trx) file…
10:46:30.817 Looking for TRX files in: D:\a\1\TestResults
10:46:30.817 No test results files found
##[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)
    The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
    Possible causes:
  5. The project has not been built - the project must be built in between the begin and end steps
  6. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0 and 15.0 are supported
  7. The begin, build and end steps have not all been launched from the same folder
  8. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
    Generation of the sonar-properties file failed. Unable to complete SonarQube analysis.
    ##[error]10:46:31.052 Post-processing failed. Exit code: 1
    10:46:31.052 Post-processing failed. Exit code: 1
    ##[error]D:\a_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.6.2\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe failed with return code: 1
    ##[section]Finishing: Run Code Analysis

please help me on this asap.

FYI: no one will even try to answer such a question where there is nothing but a log.
Please give more context and details on what you do, what you tried, … etc.

I did Azure devops setup for sonarcloud analysis and geeting above error during code analysis process.
please let me know if you need more information on this.

Thanks,
Mohan G

Did you check every of the 8 points listed as a possible cause of the problem, and make sure that your pipeline and the configuration are correct?

Hi All!

I have the same error:
2019-08-22T17:56:31.2279560Z ##[error]The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
2019-08-22T17:56:31.2279560Z ##[error]Possible causes:
2019-08-22T17:56:31.2279560Z ##[error]1. The project has not been built - the project must be built in between the begin and end steps
2019-08-22T17:56:31.2279560Z ##[error]2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 12.0 upwards are supported
2019-08-22T17:56:31.2279560Z ##[error]3. The begin, build or end steps have not all been launched from the same folder

This error became when I build with VisualStudio2017 (msbuild15).

Solution:
I set the msbuild visual studio version lower to 2015 (msbuild14).
Worked fine.

Sorry, my english is not the best.

best regards
Balázs

I am also getting this type of error often.
We are using TFS-2018 build pipeline and Sonar TFS Task(s). Run Code Analysis, Version: 4.9.0, Author: sonarsource.

Sometime it fails and sometimes it pass without any issues!