Scanner for MSBuild中没有coveragexml文件通过VSTS扩展

时间:2018-03-21 14:28:14

标签: tfs msbuild sonarqube code-coverage

使用: TFS 2017 Update-2 VS2015 VSTS任务3.2.0 SonarQube 5.6.6 LTS

将SonarQube Extension从4.0.2升级到4.1我们在运行"扫描仪进行MSBuild - End Analysis"时会收到警告。任务。

我们注意到代码覆盖率工具不生成codecoverage.xml文件(请参阅下面的日志记录)。

这仅适用于安装了VS2015的TFS代理,它适用于与VS2017相同的设置。

我们应用了解决方案:SonarQube Code Coverage from VSTS 我们将/d:sonar.cs.vscoveragexml.reportsPaths=**/*.coveragexml放在任务的附加设置中#34;扫描仪用于MSBuild - 开始分析" 但是stil没有codecoverage.xmlfiles生成

是否有其他解决方法或解决方案?

2018-03-21T10:01:20.7772938Z ##[section]Starting: Complete the SonarQube analysis
2018-03-21T10:01:20.7929236Z ==============================================================================
2018-03-21T10:01:20.7929236Z Task         : Scanner for MSBuild - End Analysis
2018-03-21T10:01:20.7929236Z Description  : [DEPRECATED] Use new version of the task
2018-03-21T10:01:20.7929236Z Version      : 3.2.0
2018-03-21T10:01:20.7929236Z Author       : SonarSource
2018-03-21T10:01:20.7929236Z Help         : [More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
2018-03-21T10:01:20.7929236Z ==============================================================================
2018-03-21T10:01:20.7929236Z Preparing task execution handler.
2018-03-21T10:01:21.1835551Z Executing the powershell script: C:\TFS\Agent\_work\_tasks\SonarQubeScannerMsBuildEnd_6d01813a-9589-4b15-8491-8164aeb38055\3.2.0\SonarQubePostTest.ps1
2018-03-21T10:01:22.3867151Z WARNING: ------------------------------------------------------------------------
2018-03-21T10:01:22.3867151Z This executable is deprecated and may be removed in next major version of the SonarScanner for MSBuild. Please use 'SonarScanner.MSBuild.exe' instead.
2018-03-21T10:01:22.3867151Z ------------------------------------------------------------------------
2018-03-21T10:01:22.3867151Z SonarScanner for MSBuild 4.1
2018-03-21T10:01:22.3867151Z Using the .NET Framework version of the Scanner for MSBuild
2018-03-21T10:01:22.3867151Z Default properties file was found at C:\TFS\Agent\_work\_tasks\SonarQubeScannerMsBuildBegin_15b84ca1-b62f-4a2a-a403-89b77a063157\3.2.0\SonarQubeScannerMsBuild\SonarQube.Analysis.xml
2018-03-21T10:01:22.3867151Z Loading analysis properties from C:\TFS\Agent\_work\_tasks\SonarQubeScannerMsBuildBegin_15b84ca1-b62f-4a2a-a403-89b77a063157\3.2.0\SonarQubeScannerMsBuild\SonarQube.Analysis.xml
2018-03-21T10:01:22.3867151Z Post-processing started.
2018-03-21T10:01:22.3867151Z 11:01:21.761  11:01:21.746  WARNING: Failed to find the code coverage command line tool. Possible cause: Visual Studio is not installed, or the installed version does not support code coverage.

1 个答案:

答案 0 :(得分:3)

#461 Failure to find VS2015 CodeCoverage.exe after searching for nonexistent registry key中正在跟踪此问题,其中列出了已知的解决方法(即手动添加注册表项或使用VS2017进行构建)。

如果构建代理同时安装了VS2015和VS2017,它也应该可以工作 - 可以使用VS2015执行构建,但扫描器结束步骤应该检测并使用VS2017版本的代码覆盖工具。

相关问题