How to see the TFS server calls made by the client



Back in 2006 I wrote a post about a performance dialog that lets you see all of the calls made by the client.  It works with Visual Studio (devenv.exe), TFS command line (tf.exe), TCM command line (tcm.exe), Test Manager (mtm.exe), etc.

It’s still in the product in 2010, and it’s as useful as ever if you are writing code that talks to TFS, and you want to optimize for performance.  It’s easy for extra calls to creep in, and this is a really easy way to keep track of it.  Also, if you find that something seems slow in VS when working with TFS, it provides a way for you to see whether it is calling the server and long it took. 

Turning it on is easy.  All you need to do is to add the following lines to the bottom of your application’s .exe.config file, just inside the closing </configuration> element.  Note that the version number below is for an app using the 2010 TFS client object model.  2008 requires, and 2005 requires

    <add name="TeamFoundationSoapProxy" value="4" />
  <trace autoflush="true" indentsize="3">
      <add name="perfListener" type="Microsoft.TeamFoundation.Client.PerfTraceListener,Microsoft.TeamFoundation.Client, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

When I edited my devenv.exe.config file to add this, I had to run Notepad (or VS) as an Administrator in order to change the file (I’m using Windows 2008 Server R2, and I expect Windows 7 requires the same).

Here’s an updated screen shot showing calls made by Visual Studio 2010 in connecting to a team project on a 2010 server.


If you hover over one of the lines in the bottom panel, you’ll get the stack trace for the call.


If you select rows from the grid, you can paste them into another document, such as a spreadsheet.  Here I selected all of the rows in the top panel and pasted the results.

 WebServiceTotalTimeLastCountAverageMin TimeMax Time



Leave a comment