I have setup my Sonar server on my AKS (Azure kubernets cluster) and using Sonar docker image version (image: sonarqube:7.1).
I have my CI/CD pipeline in Azure Devops for .net application and I am using AzureDevops SonarScanner ( sonar) .
When I am running my pipeline I am getting this error:
Description : Run scanner and upload the results to the SonarQube server.
Version : 4.11.0
Author : sonarsource
Help : Version: 4.11.0. This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.
/usr/bin/dotnet /home/vsts/work/_tasks/SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157/4.11.0/dotnet-sonar-scanner-msbuild/SonarScanner.MSBuild.dll end
SonarScanner for MSBuild 4.10
Using the .NET Core version of the Scanner for MSBuild
##[error]The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
- The project has not been built - the project must be built in between the begin and end steps
- An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
- The begin, build and end steps have not all been launched from the same folder
- 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.
My Pipeline looks like this:
- task: SonarQubePrepare@4 inputs: SonarQube: 'SonarQube-Dev' scannerMode: 'MSBuild' projectKey: 'Test' projectName: 'Test' extraProperties: | # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin sonar.projectBaseDir=/src sonar.sources=src - task: DotNetCoreCLI@2 inputs: command: 'restore' projects: '**/*.csproj' #feedsToUse: 'select' workingDirectory: '/src' - task: MSBuild@1 inputs: solution: '/*.sln' restoreNugetPackages: true clean: true - task: SonarQubeAnalyze@4