【问题标题】:TFS: PublisherNotFoundException when trying to create a subscription for "rm"TFS:尝试为“rm”创建订阅时出现 PublisherNotFoundException
【发布时间】:2017-02-15 12:35:14
【问题描述】:

本地 TFS 2015 u2。我想为发布创建事件创建一个 HTTP 服务挂钩订阅。按照 herehere 的指示,我正在向

发送 POST 请求
http://tfs.mycompany.com:8080/tfs/MyCollection/_apis/hooks/subscriptions?api-version=1.0

使用以下 JSON:

{
"publisherId": "rm",
"eventType": "ms.vss-release.release-created-event",
"resourceVersion": "1.0-preview.1",
"consumerId": "webHooks",
"consumerActionId": "httpRequest",
"publisherInputs": 
{
    "projectId": "aaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
},
"consumerInputs":
{
    "url": "http://someserver/somefolder/"
}
}

我收到以下错误消息:

{
"innerException": null,
"message": "No publisher could be found with id \"rm\".",
"typeName": "Microsoft.VisualStudio.Services.ServiceHooks.WebApi.PublisherNotFoundException, Microsoft.VisualStudio.Services.ServiceHooks.WebApi, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
"typeKey": "PublisherNotFoundException",
"errorCode": 0,
"eventId": 4501
}

确实,如果您请求发布者列表,则只有一个,ID 为“tfs”。那里没有“rm”出版商。从“tfs”发布者请求相同的订阅会产生“未知事件”错误。

我是否必须以某种方式启用该发布者?本地 TFS 是否支持它?如果有,是从哪个版本开始的?

像其他 API 文档一样,使用支持的版本注释他们的 TFS REST API 文档会伤害微软吗?

【问题讨论】:

    标签: tfs tfs-2015 tfs-sdk ms-release-management


    【解决方案1】:

    发布者是一种将事件发布到服务挂钩的服务。在 TFS 2015 update2 中,如果您请求发布者列表,您将不会获得带有“rm”的发布 ID。目前不支持 TFS2015。

    另外,实际上rm的资源版本应该是3.0

    "resourceVersion": "3.0-preview.1", 
    

    【讨论】:

    • 我想只有在托管的 TFS 中。很高兴知道,谢谢。请考虑记录这一点,以及托管和本地 TFS 之间的其他 API 差异。
    猜你喜欢
    • 2019-11-19
    • 2018-06-25
    • 2016-10-31
    • 1970-01-01
    • 2020-11-28
    • 2021-03-17
    • 2021-04-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多