[英]The SonarQube MSBuild integration failed - SonarQube 7 with Scanner 4.0.2.892 and VS2017
I'm using SonarQube 7.0 and SonarQube Scanner for MSBuild 4.0.2.892 and attempting to follow these instructions to scan my .NET application on Windows (ASP.NET Core). 我将SonarQube 7.0和SonarQube Scanner用于MSBuild 4.0.2.892,并尝试按照以下说明在Windows(ASP.NET Core)上扫描.NET应用程序。 The three commands below are part of the instructions: 以下三个命令是说明的一部分:
C:\SonarQube\Scanner\SonarQube.Scanner.MSBuild.exe begin /k:"org.sonarqube:sonarqube-scanner-msbuild" /n:"TradingPlatform" /v:"1.0"
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" /t:Rebuild
C:\SonarQube\Scanner\SonarQube.Scanner.MSBuild.exe end
However, while pre-processing succeeds on the fist command, and the build completes on the second command, the third command always fails as shown below: 但是,尽管在fist命令上预处理成功,并且在第二条命令上构建完成,但是第三条命令始终失败,如下所示:
==== ====
SonarQube Scanner for MSBuild 4.0.2 Default properties file was found at C:\\SonarQube\\Scanner\\SonarQube.Analysis.xml 用于MSBuild 4.0.2的SonarQube扫描仪默认属性文件位于C:\\ SonarQube \\ Scanner \\ SonarQube.Analysis.xml
Loading analysis properties from C:\\SonarQube\\Scanner\\SonarQube.Analysis.xml 从C:\\ SonarQube \\ Scanner \\ SonarQube.Analysis.xml加载分析属性
Post-processing started. 后处理开始。
The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects. SonarQube MSBuild集成失败:SonarQube无法收集有关您的项目的必需信息。
Possible causes: 可能的原因:
Generation of the sonar-properties file failed. 声纳属性文件的生成失败。 Unable to complete SonarQube analysis. 无法完成SonarQube分析。
Exit Code 1. 退出代码1。
==== ====
Does anyone have any idea why it's failing? 有谁知道为什么它会失败? Cause 1 can't be the case as I'm building the project in step 2. Cause 2 seems very unlikely (but not impossible) as I'm using MSBuild 15. Cause 3 also can't be the case as I'm running all three commands from the same location 由于在步骤2中构建项目时,原因1不可能是这种情况。由于使用MSBuild 15,原因2似乎不太可能(但并非不可能),因为我使用MSBuild 15时,原因3也不可能这样。从同一位置运行所有三个命令
Other possible reasons are: 其他可能的原因是:
<ProjectGuid>XXXXX</ProjectGuid>
element in the first PropertyGroup
in your csproj, where XXXXX is a newly generated Guid. 在csproj的第一个PropertyGroup
中添加<ProjectGuid>XXXXX</ProjectGuid>
元素,其中XXXXX是新生成的Guid。 If this does not help, add /d:sonar.verbose=true
on the begin
command of the scanner and save all logs into a file. 如果这样做没有帮助, /d:sonar.verbose=true
在扫描仪的begin
命令上添加/d:sonar.verbose=true
并将所有日志保存到文件中。 Zip the logs and the .sonarqube
folder from your build workspace and upload them here: https://www.dropbox.com/request/CszJAO1ZNXFVl1gwo5hA 从您的构建工作区压缩日志和.sonarqube
文件夹,并将其上传到此处: https : .sonarqube
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.