我在执行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>
答案 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
我的步骤:
$(Build.SourcesDirectory);
npm命令:install
;参数:vss-web-extension-sdk
)$(Build.SourcesDirectory);
清单文件:vss-extension.json
)注意:我的扩展文件位于源目录中($(Build .SourcesDirectory)),例如vss-extension.json等......