2017-03-02 37 views
0

執行VSTS開發人員工具構建任務時出現以下錯誤,我已包含擴展清單,請幫助我解決此問題。VSTS開發人員工具構建任務錯誤:根據打開包裝約定規範中定義的每個規則,部分URI無效

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> 
+0

ahh我很抱歉,由於所有的vs-team-services和vsts標籤問題,我之前對擴展類型感到困惑。目前尚無任何發佈到舊的Visual Studio Gallery的任務。儘管我希望很快能夠支持新的市場。現在,您仍然需要通過https://visualstudiogallery.msdn.microsoft.com/ – jessehouwing

+0

發佈清單文件是JSON文件。我更新了我的答案,你可以檢查它。 –

回答

1

關於VSTS開發工具構建的任務,清單文件是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等...
相關問題