当我尝试从Visual Studio Online查询所有事件订阅时,我收到以下错误: "要求的价值'持有的通知'没找到。"
我的代码:
var server = TfsProvider.GetServer(tfsUri);
var eventService = (IEventService)server.GetService(typeof(IEventService));
var subscriptions = eventService.GetAllEventSubscriptions(); // Exception here
答案 0 :(得分:1)
似乎将在Microsoft.TeamFoundation.Client
(build 14.0.22821.0)的2015 RC版本中修复
请参阅此答案以了解装配位置:Where can I find Microsoft.TeamFoundation.Build.Client in Visual Studio 2015?
答案 1 :(得分:0)
我通过调用GetAllEventSubscriptions()方法的重载来解决这个问题:
var subscriptions = eventService.GetAllEventSubscriptions("My Notification Classification");
我很幸运,我确切地知道参数的价值。从VSO获取所有活动订阅列表仍然是个问题。
以下是我创建订阅的示例:
var preference = new DeliveryPreference
{
Schedule = DeliverySchedule.Immediate,
Type = DeliveryType.Soap,
Address = deliveryAddress,
};
var id = eventService.SubscribeEvent(EventType, string.Empty, preference, "My Notification Classification");