VSTS扩展版本汇总部分

问题描述:

我已经通过VSTS扩展将“自定义汇总”部分添加到“构建汇总”部分。VSTS扩展版本汇总部分

我在关于构建完成的VSTS构建摘要部分收到以下错误。 enter image description here

“无法加载ABC的VSTS扩展。了解有关此扩展的更多信息,包括可用的支持选项。”

贡献:

 "id": "abcfef-build-status-section", 
     "type": "ms.vss-build-web.build-results-section", 
     "description": "ABC Scan Summary", 
     "targets": [ 
      ".build-info-tab", 
      "ms.vss-build-web.build-results-summary-tab" 
     ], 
     "properties": { 
      "name": "ABC Summary Section", 
      "uri": "buildstatus.html", 
      "order": 20, 
      "height": 500 
     } 

范围:

"scopes": [ 
    "vso.build", 
    "vso.build_execute" 
] 

Html页面(buildstatus.html):

<!DOCTYPE html> 
 
<html xmlns="http://www.w3.org/1999/xhtml"> 
 
<head> 
 
    <title>Hello World</title> 
 
    <script src="scripts/VSS.SDK.js"></script> 
 
</head> 
 
<body> 
 
    <script type="text/javascript">VSS.init();</script> 
 
    <h1>Hello World</h1> 
 
    <script type="text/javascript">VSS.notifyLoadSucceeded();</script> 
 
</body> 
 
</html>

PLE有助于解决这个问题。

在此先感谢。

+0

你能分享你的完整日志你构建的? –

我通过分析Chrome浏览器的控制台日志发现问题。看来我的组织防火墙正在阻止API调用来检索资源。 :)

https://xxxxxxxx.gallery.vsassets.io/_apis/public/gallery/publisher/xxxxxxxxxxxxxxxxxxxxxxxx=/Extension/status.html无法加载资源:净:: ERR_CONNECTION_CLOSED

Thanks-

我们知道,对于建立一个existing extension sample结果增强器,以及源代码可以在GitHub上找到:https://github.com/Microsoft/vsts-extension-samples/tree/master/build-results-enhancer

似乎有什么不对的贡献,你可能会关注你的HTML页面上,并尝试在你的HTML页面中添加usePlatformScripts: true,看看问题是否仍然存在:

<head> 
    <title>Hello World</title> 
</head> 
<body> 
    <script src="scripts/VSS.SDK.js"></script> 
    <script type="text/javascript"> 
     VSS.init({ 
      usePlatformScripts: true 
     }); 
    </script> 
    <h1>Hello World</h1> 
</body> 
</html> 

这通常是由VSS.SDK.js文件引起启动扩展时无法加载,请检查下面的事情:

  1. html页面中的src路径“scripts/VSS.SDK.js”是正确的。
  2. src路径和文件包含在“vss-extension.json”文件的“文件”部分中。