首页 > 解决方案 > 构建配置为运行 SonarQube 分析,但无法找到 SonarQube 分析目标

问题描述

我是 .Net 的新手,也是使用 MS Build 的 SonarScanner 的新手。我期待您的帮助,以解决我在 sonarscanner-msbuild begin process 之后构建项目时遇到的错误。

C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\MSBuild\14.0\Microsoft.Common.targets\ImportBefore\SonarQube.Integration.ImportBefore.targets(62,5): error : The build is configured to run SonarQube analysis but the SonarQube analysis targets could not be located. Project: XYZ.csproj [E:\jenkins\workspace\XYZ\XYZ.csproj]

标签: sonarqubesonarqube-msbuild-runner

解决方案


提示和线索:

  1. 确保SonarScanner.MsBuild begin在执行之前已经运行MsBuild
  2. MsBuild使用switch运行/v:diagnostic以获取详细的故障排除日志。在日志查找SonarQubeTargetsPathSonarQubeTargetFilePath值中。
  3. 如果遇到这种或其他配置困难,请参阅我关于如何在 .NET 生态系统中设置 SonarQube 的教程:https ://blog.pragmasoft.pl/software/2018-10-10-sonarqube-2-setup-environment/

推荐阅读