【发布时间】:2016-09-20 18:05:47
【问题描述】:
我正在尝试编写一个 HelloWorld TFS 插件。我创建了一个类库项目。代码在这里:
using Microsoft.TeamFoundation.Common;
using Microsoft.TeamFoundation.Framework.Server;
using Microsoft.TeamFoundation.VersionControl.Server;
using Microsoft.TeamFoundation.WorkItemTracking.Server;
using System;
using System.Diagnostics;
namespace TFSServerSideHandler
{
public class WorkItemChangedEventHandler : ISubscriber
{
EventLog appLog = new EventLog();
public string Name
{
get { return "WorkItemChangedEventHandler"; }
}
public SubscriberPriority Priority
{
get { return SubscriberPriority.High; }
}
public EventNotificationStatus ProcessEvent(
TeamFoundationRequestContext requestContext,
NotificationType notificationType,
object notificationEventArgs,
out int statusCode,
out string statusMessage,
out ExceptionPropertyCollection properties)
{
statusCode = 0;
properties = null;
statusMessage = String.Empty;
try
{
appLog.Source = "WorkItemChangedEventHandler";
appLog.WriteEntry("Handled event : " + notificationEventArgs.GetType().Name);
}
catch (Exception exception)
{
appLog.Source = "WorkItemChangedEventHandler";
appLog.WriteEntry("Couldn't Handle event : " + notificationEventArgs.GetType().Name + " Exception : " + exception.ToString());
}
return EventNotificationStatus.ActionPermitted;
}
public Type[] SubscribedTypes()
{
return new Type[] { typeof(WorkItemChangedEvent), typeof(CheckinNotification) };
}
}
}
我构建项目,然后将所有文件从 \TFSServerSideHandler\bin\Debug 部署到我的 C:\Program Files\Microsoft Team Foundation Server 12.0\Application Tier\Web Services\bin\Plugins TFS 服务器。
我正在使用带有更新 5 (12.0.40629.0 (Tfs2013.Update5)) 的 TFS 2013 的最小安装。 当我将代码签入到此 TFS 服务器或更改工作项时,我应该会看到日志条目,但我的代码中没有看到任何日志条目。谁能指出我在这里缺少的东西?
【问题讨论】:
-
我还在 TFS 服务器上安装了 Visual Studio 远程调试工具。我尝试将 Visual Studio 调试器附加到 TFS 服务器上的 w3p.exe,但从未遇到过断点,因为发生了签入事件。
标签: tfs