未能将下载的代码覆盖工具转换为XML

本文关键字:工具 转换 XML 覆盖 代码 下载 | 更新日期: 2023-09-27 18:17:27

我在TFS 2013上启用了代码覆盖。我使用MSBuild.SonarQube.Runner 1.0.1。当我运行分析的结束阶段时。我得到以下错误消息:

    11:36:00.269  Failed to convert the downloaded code coverage tool to XML. No code coverage information will be uploaded to SonarQube.<br/>
     Check that the downloaded code coverage file (C:'Builds'39'[product name]'System_Main_Release_Code_Analysis'.sonarqube'out'VSCodeCoverageReport.coverage) is valid by opening it in Visual Studio. If it is not, check that the internet security settings on the build machine allow files to be downloaded from the Team Foundation Server machine.
     Post-processing failed. Exit code: 1
An error occurred while copying diagnostic activity logs to the drop location. Details: Forbidden
在构建服务器上没有VSCodeCoverageReport。覆盖文件——至少不在指定的位置和名称。然而,当我在TFS构建摘要中点击(Coverage Results)时,就会下载一个覆盖文件,并在Visual Studio中的代码覆盖结果窗口中打开。

有什么问题吗?

未能将下载的代码覆盖工具转换为XML

问题已解决。生成代理上的代理设置已更改。这会导致对TFS服务器或任何本地地址的http请求失败。
要弄清楚这一点尤其具有挑战性,因为告诉您构建的所有细节的Agent构建日志是无法传输到放置位置的文件。

所以我使用了Sysinternals中的ProcMon,并在构建期间启用了文件监视器。比较过去成功的构建和当前失败的构建,可以看到哪个文件丢失了(代理日志文件)。在ProcMon中搜索该文件可以发现该文件在构建代理中的位置。特工日志文件里有迪内希想要帮我找的Downloading coverage file from {0} to {1}线。粘贴到浏览器中的http地址显示了一条"拒绝访问"的消息。
从那里,分析代理设置是一个合乎逻辑的步骤。最终解决的办法是在局域网(LAN)设置中检查"绕过本地地址的代理服务器"