Click here to Skip to main content
13,352,879 members (43,098 online)
Click here to Skip to main content
Add your own
alternative version


17 bookmarked
Posted 21 Aug 2007

TFS Event Handler Prototype Configuration Demystified

, 21 Aug 2007
Rate this:
Please Sign up or sign in to vote.
There are a number of config options for the TFS Event Handler Prototype. I will describe all of them in depth here. The first step is to set the Windows Communication Foundation service options, which really only requires you to change one value.


There are a number of config options for the TFS Event Handler Prototype. I will describe all of them in depth here. The first step is to set the Windows Communication Foundation service options, which really only requires you to change one value.

        <service name="RDdotNet.TeamFoundation.NotificationService">
            <endpoint address="http://[LocalMacheneName]:8677" 



                contract="RDdotNet.TeamFoundation.INotificationService" />

The important one is the [LocalMacheneName] variable, which should be set to the local machine name, or the domain name that points to your computer if you have a crazy proxy.

The next step is to set the real options for this software. This starts with the <RDdotNet.TeamFoundation> options, and requires you to set a number of things.

<BaseAddress url="http://[LocalMacheneName]:3624/" />

Again, you need to set the machine name, but make sure that the port is different.

    <TeamServer name="[TFS Server Name]"

                url="http://[TFS Server Name]:8080/"

                subscriber="[Subscriber AD Account]"

                mailAddressFrom="[From Email Address]"

                mailFromName="[Form name]"

                mailServer="[email relay server]"



                testEmail="[email to send testes to]"


In the Team Servers section, you need to list of all of the team servers that you are going to be handling events for. The system will automatically add event subscriptions for all Team Servers added here, but I have only tested with two, and I now always run the service on the TFS server.

TeamServer Options
nameSystem.StringThis should be a friendly name for the Team Foundation Server
urlSystem.UriThe URI for the TFS you wish to connect to, including protocol and port
mailFromAddressSystem.StringThe address from which you want all emails sent by the system to say that they are sent
mailFromNameSystem.StringThe display name of the from email address
mailServerSystem.StringThe mail server that you have permission for to send emails
logEventsSystem.BooleanA true or false value that enables logging of all events within that system; excellent for debugging...
testModeSystem.BooleanWhen in test mode, all emails sent by the system will only be sent to the email address defined by testEmail; set to false for production
testEmailSystem.StringThe email address that, when testMode is enabled, will receive all emails sent from the system
eventLogPathSystem.StringThe location that the event logs will be written to; all events received get assigned a System.Guid, and all logs pertaining to that event get saved in the corresponding folder
subscriberSystem.StringThe AD account name of the account that is writing the events; set to the name of your TFSSetup or TFSService accounts

Now you are ready to set the event handlers. These are defined within the "Events" section:

  • AclChangedEvent
  • Branchmovedevent
  • BuildCompletionEvent
  • BuildStatusChangeEvent
  • CommonStructureChangedEvent
  • DataChangedEvent
  • IdentityChangedEvent
  • IdentityCreatedEvent
  • IdentityDeletedEvent
  • MembershipChangedEvent
  • WorkItemChangedEvent

Now you need to add handlers for the events. Example:

<Event eventType="WorkItemChangedEvent">
    <Handler type="RDdotNet.TeamFoundation.WorkItemTracking.AssignedToHandler"



<Event eventType="WorkItemChangedEvent">
    <Handler type="RDdotNet.TeamFoundation.WorkItemTracking.AssignedToHandler"



As you can see, you are theoretically allowed to use any event. Please keep in mind that only the WorkItemChangedEvent and the CheckInEvent have been tested. When you add the "Event" tag with the corresponding eventType (which is an enumerator), this tells the system which specific events to subscribe to.

You can then add handlers to an event. These handlers are fired whenever these events are received.

eventTypeRDdotNet.TeamFoundation. EventTypesEnumerator that defines the list of possible events.
typeSystem.TypeThis must be a valid type in the assembly listed in assemblyFileName
assemblyFileNameSystem.StringThis must be a valid assembly found in the assemblyFileLocation
assemblyFileLocationSystem.StringA location within the server's file system that holds this assembly; ~ denotes the application's root

If you are using friendly server names or TeamPlain, you can change the TFS server links to be TeamPlain ones using the UrlReplacements config element:

    <!-- The Url Replaces change the url listed in the event to valid public items
        This item changes the TFS url to a TeamPlain v1 url
        <Replace eventType="WorkItemChangedEvent" 
          new="/workitem.aspx?id=" />
        These items change the server location to a public host header:
        <Replace eventType="WorkItemChangedEvent" 
          new="[PublicProductionEnviromentUri]" />
        <Replace eventType="WorkItemChangedEvent" 
          new="[PublicDevelopmentEnviromentUri]" />

This works by replacing values within the URL in the events. You specify the event type, what to look for, and what to replace it by. This allows greater control and the integration of TeamPlain into your world. If a task is assigned to someone outside of your departmental sphere who you have given permission to TFS but who knows nothing about it, they will still get an email that will link them through to TeamPlain.

And, that is it, you are all set. If you have installed the service and set the account that is used to run the service, you should get no errors when starting. No guarantees though :)


This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


About the Author

Martin Hinshelwood
Instructor / Trainer naked ALM
United States United States

About the Author: Martin has worked with many customers in government, finance, manufacturing, health and technology to help them improve their processes and deliver more. He provides management and technical consulting that intends to expose processes and practices to gain transparency, uncover impediments to value delivery and reduce cycle-time as part of an organisations path to agility. Martin is a Professional Scrum Trainer as well as a Visual Studio ALM MVP and Visual Studio ALM Ranger. He writes regularly on, and speaks often on Scrum, good practices and Visual Studio ALM.

You can get in touch with Martin through naked ALM.

You may also be interested in...

Comments and Discussions

GeneralException while running testapp [modified] Pin
marceloramos22-Nov-07 11:17
membermarceloramos22-Nov-07 11:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.180111.1 | Last Updated 22 Aug 2007
Article Copyright 2007 by Martin Hinshelwood
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid