TFS 2010 introduced a new concept with Server-side event handlers, which use a Plug-in model that allows custom code to execute upon a TFS event, and run under the TFS context. So the two big advantages here is that you no longer have to deploy a separate SOAP-based web service, and since you are running under the TFS context, you have direct access to the TFS API with much less hops across different processes.
The solution consists of a .NET Class that implements the Microsoft.TeamFoundation.Framework.Server. ISubscriber interface:
public interface ISubscriber
{
string Name { get; }
SubscriberPriority Priority { get; }
EventNotificationStatus ProcessEvent(TeamFoundationRequestContext requestContext, NotificationType notificationType, object notificationEventArgs, out int statusCode, out string statusMessage, out ExceptionPropertyCollection properties);
Type[] SubscribedTypes();
}
you can find coplete reference in these links:
Team Foundation Server 2010 Event Handling with Subscribers[
^]
http://www.almguide.com/2011/12/tfs-server-side-event-handlers/[
^]