【发布时间】:2020-12-26 13:45:58
【问题描述】:
我已经在我的 AKS(Azure Kubernetes 集群)上设置了我的 Sonar 服务器,并使用了 Sonar docker 镜像版本(镜像:sonarqube:7.1)。
我在 Azure Devops for .net 应用程序中有我的 CI/CD 管道,我正在使用 AzureDevops SonarScanner (声纳)。
当我运行我的管道时,我收到了这个错误:
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
Post-processing started.
##[error]The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:
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.
我的管道如下所示:
- 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: MSBuild@1
inputs:
solution: '/*.sln'
restoreNugetPackages: true
clean: true
- task: SonarQubeAnalyze@4
【问题讨论】:
标签: .net c#-4.0 azure-devops sonarqube