VSTS开发人员工具构建任务错误:根据“打开包装约定”规范

时间:2017-03-02 17:03:24

标签: continuous-integration azure-devops tfsbuild azure-pipelines tfs2017

我在执行VSTS开发者工具构建任务时遇到以下错误,我已经包含了扩展清单,请帮我解决这个问题。

  

错误:请求失败:错误请求(400) - 部分URI无效   开放式包装约定规范中定义的规则。 TFX   失败并出现错误:错误:C:\ agent_work_tools \ tfx.cmd失败   返回码:4294967295 -

<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011">
  <Metadata>
    <Identity Id="91abfa6b-b004-4d4c-9c70-xxxxxxx" Version="1.0" Language="en-US" Publisher="bandara" />
    <DisplayName>MyTestExt</DisplayName>
    <Description xml:space="preserve">VS Extension</Description>
  </Metadata>
  <Installation>
    <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[14.0]" />
  </Installation>
  <Dependencies>
    <Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" Version="[4.5,)" />
    <Dependency Id="Microsoft.VisualStudio.MPF.14.0" DisplayName="Visual Studio MPF 14.0" Version="[14.0]" />
  </Dependencies>
  <Assets>
    <Asset Type="Microsoft.VisualStudio.VsPackage" Path="MyTestExt.pkgdef" />
  </Assets>
</PackageManifest>

1 个答案:

答案 0 :(得分:1)

关于VSTS Developer Tools构建任务,清单文件是JSON文件而不是XML文件,您也可以使用VSIX文件(Published by tfx command)。

JSON文件喜欢这个:

{
    "manifestVersion": 1,
    "id": "sample-extension",
    "version": "0.1.0",
    "name": "My first sample extension",
    "description": "A sample Visual Studio Services extension.",
    "publisher": "fabrikamdev",
    "targets": [
        {
            "id": "Microsoft.VisualStudio.Services"
            }
        ],
    "icons": {
        "default": "images/logo.png"
     },
    "contributions": [
        {
            "id": "Fabrikam.HelloWorld",
            "type": "ms.vss-web.hub",
            "description": "Adds a 'Hello' hub to the Work hub group.",
            "targets": [
                "ms.vss-work-web.work-hub-group"
                ],
            "properties": {
                "name": "Hello",
                "order": 99,
                "uri": "hello-world.html"
            }
        }
    ],
    "scopes": [
        "vso.work"
    ],
    "files": [
        {
            "path": "hello-world.html", "addressable": true
        },
        {
            "path": "scripts", "addressable": true
        },
        {
            "path": "sdk/scripts", "addressable": true
        },
        {
            "path": "images/logo.png", "addressable": true
        }
    ]
}

更多信息,您可以参考这篇文章:Your extension's manifest file: vss-extension.json

我的步骤:

  1. Acquire a personal access token(确保选择所有可访问的帐户)并添加服务端点
  2. 编辑/创建构建定义
  3. 添加npm安装构建步骤/任务(工作文件夹:$(Build.SourcesDirectory); npm命令:install;参数:vss-web-extension-sdk
  4. 添加发布扩展步骤/任务(检查扩展清单文件选项;根清单文件夹:$(Build.SourcesDirectory);清单文件:vss-extension.json注意:我的扩展文件位于源目录中($(Build .SourcesDirectory)),例如vss-extension.json等......