Wednesday, November 30, 2022 ..:: ::.. Register  Login
 Bloggers Minimize

 Sponsors Minimize

 Users Online Minimize
Membership Membership:
Latest New User Latest: AdeleGadsden
New Today New Today: 96
New Yesterday New Yesterday: 65
User Count Overall: 18956

People Online People Online:
Visitors Visitors: 322
Members Members: 0
Total Total: 322

Online Now Online Now:

 Welcome to! Minimize

If you are a developer or designer who is creating cutting edge user interface experiences using Microsoft Expression Blend you've just found a great resource!  The purpose of this site is to share our experience with this brand new product.  As with any new piece of software there is a ton to discover.  Bugs will be revealed and workarounds discovered, hopefully this can be a resource to share in the discovery process!

While this site will focus largely on Expression Blend, it will also encompass WPF, Visual Studio, Silverlight, and other .net 3.5 technologies as they relate to the creation of great software.

Please login using your Microsoft LiveID or register a new account.  Doing so will let you comment on any of the blog entries on the site.  We look forward to helping you in your endeavors as well as you helping others in theirs!  We'd love to have more bloggers on our site...if you are interested please register and contact us!

Follow us:

 Visual Studio 2010 TFS WorkItemEventChanged Alerts and WCF with sample web project Minimize
Location: BlogsSean Cullinan    
Posted by: Sean Cullinan 6/18/2010 3:26 PM


We are finally in the process of implementing Visual Studio TFS where I work.  In our process exploration we decided we would need to write a webservice that TFS could notify whenever a workitem or other change happened. 

TFS lets you setup alerts, in 2010 you can simply do this by going to the Team->Alerts Explorer window.  You are greeted with an interface that lets you setup an alert type, conditions for the alert, and how you want the alert to happen.  You can alert people via Plain Text or HTML email OR you can also alert a webservice/wcf via SOAP.  Basically when the conditional is met it makes a SOAP call to a webservice you setup.

There were no real "starter projects" that I could find that were for building it using WCF in VIsual Studio 2010/.net framework 4.0.  Everything on the web was a bit outdated.  Needless to say when I created the service and setup the alert to call it nothing happened.  The first step was figuring out why the failure happened and to do this you need to setup the TFS server to log what happens when it tries to make the alert.  This is done by editing the TFSJobAgent.exe.config file located on the TFS application server in the C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\TFSJobAgent folder.  You need to edit the system.diagnostics section, here's how mine looks:

    <trace autoflush="false" indentsize="4">
      <!--To enable tracing to file, simply uncomment listeners section and set trace switch(es) below.
          Directory specified for TextWriterTraceListener output must exist, and job agent service account must have write permissions. -->
        <add name="myListener"
          initializeData="C:\windows\temp\jobagent.log" />
        <remove name="Default" />
      <!--  Trace Switches
            Each of the trace switches should be set to a value between 0 and 4, inclusive.
              0: No trace output
              1-4: Increasing levels of trace output; see Systems.Diagnostics.TraceLevel-->
      <add name="API" value="0" />
      <add name="Authentication" value="0" />
      <add name="Authorization" value="0" />
      <add name="Database" value="0" />
      <add name="General" value="3" />
      <add name="traceLevel" value="1" />

This logs things, including the status of alert failures to c:\windows\temp\jobagent.log (you can change this of course).  Once you do this you need to restart the Visual Studio Team Foundation Background Job Agent" service.

Checking the logs I saw that the following error message ocurring (just posting relevant section):  HTTP code 415: Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'

After much googling I discovered that this is because TFS 2010 is using SOAP 1.2 and needs wsHttpBinding setup on the service application.  Unfortunately this took me forever to figuer out how to get it working.  I had to modify my services web.config but kept getting errors because I wasn't specifying the full name <namespace.interface/class> in my web.config.  With no starter/sample project to work with I was flying pretty blind and the error messages were not very intuitive.  After much trial and error I figured out the proper web.config settings and all was working!

Attached is a great sample/starter project for creating your TFS2010 notification WCF services in Visual Studio 2010/.net 4.0.  My sample is posted in VB but it is easy to convert to C#.  Hopefully this helps others avoid the confusion, frustrations and problems I had.  It would be nice if MS would've shipped a starter template for creating this but they did not.

Also note that notifications by default are processed in batch every 2 minutes in TFS 2010.  You can set this to a shorter value by following this article (just paste the commands into powershell):

(Updated 6/18/2010) I just updated the sample project.  It now contains code to nicely parse out the eventXML into an object!  I used Linq for the XML parsing.  This is now a great starter project that you can use not only to get your service running but also get a defined "ChangedWorkItem" object to work with.


Permalink |  Trackback

Comments (1)   Add Comment    By fitflop shoes on 3/5/2014 9:59 PM
<p>We announced our run <a href="" title="coach factory">coach factory outlet online</a> and by Tuesday morning, we had emails from running crews around the world who wanted to take this <a href="" title="michael kors outlet">michael kors outlet</a> global, to which we said HELL YEAH! The <a href="" title="coach factory">coach factory outlet</a> hue is much more fun, and it's made from a tougher <a href="" title="coach factory outlet">coach outlet</a>.Models wear creations for <a href="" title="michael kors outlet">michael kors outlet</a>'s ready-to-wear autumn/winter collection. Since then, <a href="" title="coach outlet store online">coach outlet store online</a> got his physical act back together with some winter training in his <a href="" title="coach outlet store online">coach outlet store online</a> as well as a trip to <a href="" title="fitflops">fitflop</a> summer in Patagonia.The 36-year old "<a href="" title="coach handbags">coach handbags outlet</a> Lines" singer returned to the stage last night for his first concert following the news of he and <a href="" title="coach factory handbags outlet">coach factory outlet</a>'s separation, and he opened up to the audience before dedicating his song "<a href="" title="fitflop">fitflop shoes</a>" to his estranged wife. </p><br><p>It has to fall somewhere between <a href="" title="prada outlet">prada outlet</a> and sensible (granted, that's a word rarely uttered along the front rows of any runway). What's your secret to traveling in style?Here are some <a href="" title="flip flops">fitflop shoes</a> paper dolls to help you create your own <a href="" title=""></a>. How (ahem) scandalous.We have seen <a href="" title="flip flops">fitflops</a> for several charities. Clarks Sportswear Tawyer silhouette by fitflops, we're given a couple new angles on the shoe, which is dressed up in navy and burgundy, with leather laces and a rubber;</p><br>

Your name:
Add Comment   Cancel 

 Search Minimize

 Archive Minimize

 Blendblog Survey Minimize
Our next client application will be written using:

Which Tablet Do you expect to buy?

Submit Survey  View Results

Copyright 2011 by   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2022 by DotNetNuke Corporation