【发布时间】:2018-10-30 21:29:03
【问题描述】:
对于许多用户来说非常常见的问题,SonarQube 代码分析失败并出现错误:
[10:06:05]No ProjectInfo.xml files were found. Possible causes:
[10:06:05]1. The project has not been built - the end step was called right
after the begin step, without a build step in between
[10:06:05]2. An unsupported version of MSBuild has been used to build the
project. Currently MSBuild 12.0 upwards are supported
[10:06:05]3. The build step has been launched from a different working folder
[10:06:05]Post-processing failed. Exit code: 1
[10:06:05]Process exited with code 1
很多参考资料都说修复是使用 MSBuild.exe 的完整路径,但是是的,我使用完整路径,而且我使用最新 C# 版本的 MSBuild 15.0 版本,旧的 MSBuild 只是因为代码中的新 C# 功能而失败.
但是我无法摆脱这个错误,我不知道可以做些什么,所以也许你们中的任何人已经遇到过这个问题并且可以帮助我?
已编辑
我很确定这些步骤都不应该是失败的原因,第二个只是最接近的一个,因为我的构建步骤是
Team City 构建步骤如下所示。
第 XX 步:
cd %projectDirectory%
"C:\sonarqube-5.3\bin\MSBuild.SonarQube.Runner\MSBuild.SonarQube.Runner.exe" begin ... params
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild.exe" "MyProject.sln" /t:Clean;Rebuild
步骤 XY:
...
Step XZ:(最后一个)
cd %projectDirectory%
"C:\sonarqube-5.3\bin\MSBuild.SonarQube.Runner\MSBuild.SonarQube.Runner.exe" end
对我来说,它看起来非常简单易懂,但我仍然得到了那个错误,我不知道为什么,错误是在最后一步 (XZ) 中抛出的。
【问题讨论】:
-
您的问题涉及潜在原因 #2。 #1 和 #3 呢?
-
感谢您的回复,我编辑了一点我的问题,也许这会提供更多关于我的问题的细节
-
第 XY 步会发生什么?该步骤/那些步骤是否会干扰“结束分析”步骤所需的数据/工件?如果省略步骤 XY,分析是否成功?
-
还有其他 javascript,resharper 正在运行,实际上它在 c# 版本更新和新的 MSBuild 版本使用之前运行良好,所以我想知道 MSBuild 新版本是否不会生成 ProjectInfo.xml 或任何其他东西正在发生
标签: c# msbuild sonarqube teamcity analysis