VSTS Developer Tools Build Tasks Error: Part URI is not valid per rules defined in the Open Packaging Conventions specification

懵懂的女人 提交于 2020-01-17 06:42:30

问题


I'm getting following error when executing VSTS Developer Tools Build Tasks, I have included extension manifest, Please help me to resolve this.

error: Failed Request: Bad Request(400) - Part URI is not valid per rules defined in the Open Packaging Conventions specification. tfx failed with error: Error: C:\agent_work_tools\tfx.cmd failed with return code: 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:


Regarding VSTS Developer Tools Build tasks, the manifest file is the JSON file instead of a XML file, you also could use VSIX file (Published by tfx command).

The JSON file likes this:

{
    "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
        }
    ]
}

More information, you can refer to this article: Your extension's manifest file: vss-extension.json

My steps:

  1. Acquire a personal access token (make sure you select All accessible accounts) and add service endpoint
  2. Edit/create build definition
  3. Add npm install build step/task (working folder: $(Build.SourcesDirectory); npm command: install; arguments: vss-web-extension-sdk)
  4. Add Publish Extension step/task (Check Extension manifest file option; Root manifest folder: $(Build.SourcesDirectory); Manifest file: vss-extension.json) Note: My extension files are in source directory ($(Build.SourcesDirectory)), such as vss-extension.json etc…


来源:https://stackoverflow.com/questions/42561554/vsts-developer-tools-build-tasks-error-part-uri-is-not-valid-per-rules-defined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!