SonarCloud analysis error in Azure DevOps

I am new to SonarCloud and trying to integrate it with AzureDevOps pipeline for one of my web projects. I am getting the following error when at SonarCloudAnalyze task in the pipeline, any help is much appreciated.

SonarScanner for MSBuild 5.3.1
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
##[error]02:11:39.815 The SonarScanner for MSBuild integration failed: SonarCloud 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.25420.1 and higher 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)
    02:11:39.815 The SonarScanner for MSBuild integration failed: SonarCloud 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.25420.1 and higher 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)
    02:11:39.816 Generation of the sonar-properties file failed. Unable to complete the analysis.
    ##[error]02:11:39.824 Post-processing failed. Exit code: 1
    02:11:39.824 Post-processing failed. Exit code: 1
    ##[error]The process ‘D:\a_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.21.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 1

Hello,

You probably have an issue with the way you have setup your analysis steps.
Please have a look at this guide on how to setup your project: Driving continuous quality of your code with SonarCloud | Azure DevOps Hands-on-Labs

Feel free to come back to this thread if you have more questions after that.

1 Like

Thanks for your quick reply Gregorie, I looked into the documentation and as indicated there I was trying to configure code analysis method for the project by login into SonarCloud account but I don’t see anyway to save the configuration, for example when I select “What option best describe your build” and “What is you build tool” they are not sticking. Here is the screenshot -

Also, the documentation illustrates an example for setting up pipeline for .Net for desktop app, can you direct me for any documentation on ASP.Net? Also in the documentation I don’t see any steps to configure SonarCloud analyze task, am I missing anything?

@SonarSorcerer would appreciate any help in resolving this issue. As I am a newbie, any guidance or advice o this matter is greatly appreciated.