Ideas and contributions for plugins and other extensions


I've been playing with the TeamCity API lately and I've had many ideas for plugins and other generic extensions not strictly related to plugin development. As they started to grow I felt the need to publicize them and what I've done so far so that someone can eventually jump on the train.

  • C# runner plugin - represents a build runner which is able to run C# code on the agent, much like LINQPad but on TeamCity
  • Dependency graph plugin - a custom tab which shows dependencies between build types in a graph
  • TFS issue tracker integration - integrates TFS into TeamCity
  • Pivot viewer for TeamCity - based on the new pivot viewer control for Silverlight, a proof on concept for displaying TeamCity projects/buildtypes/builds based on the example available here
  • Google project hosting issue tracker integration with TeamCity - just an idea right now, there is a Java API and would be useful for OS projects using Google hosting
  • TC build runner to run other builds - an idea as well, would provide a means to trigger other builds, useful when you want to batch a group of builds, for example. This funtionality is already available via HTTP calls to TC

Dependency graph plugin sounds interesting to me, and we at JetBrains would benefit from it too. Just do not have enough time to make it.

The plugin which compares tests (number or passed / failed / ignored) with previous build (or with selected build) would be useful too. In fact this should be a part of TeamCity, as it would be useful to many users.

Also a notifier which shows a message from administrator to all of the users, would be helpful.


I've also created a simple application to watch for changes to the configuration files and persist them on a TFS repository:



I tried downloading the TFS Issue Tracker plugin from the CodePlex site, but got an error message: "You do not have sufficient permissions to download project, project 50" from the TeamCity server that is redirects me to from the download link.

Any ideas?


Hi Carel, you should be able to access the download link now.


Hi Simone

Thanks for the download link.    We are not yet using TFS 2008 - still stuck on TFS 2008 still end of June 2011.  I had a quick look at the solution structure and it seems like it might be as simple as replacing the TeamFoundation libraries with the TFS 2008 binaries.  I know there were some API changes between TFS 2008 + TFS 2010 so again it might break some stuff.  Am I on the right track?



Yes, right track, it should be pretty easy. I couldn't do it as I didn't have an instance of TFS 2008 server to test the API on. I know it isn't easy to do it on Codeplex, but I would be glad if you wanted to contribute the code then.


I use Tfs 2010 Explorer against a Tfs 2008 instance regularly so I expect it to work without any code changes provided that the Tfs 2010 Client is installed on the build server.

I have done that and I can successfully add a Tfs connection in the Server Configuration > Issue Tracker page, however when I check in code and associate it with a bug sheet I don't see the work item linked in Team City. Do I need to put the work item id in the comments? Does it work with any Tfs Process Template (I use Scrum for Team System)?


Hi Alex, as I said I don't know what it entails connecting to a 2008 instance as I don't have a chance to try it out, but I take you should be able to connect as long as you have the TeamExplorer (and thus the API used byt the plugin) installed on the machine.
The plugin works by looking at the work items associated to the changeset, so you don't have to put the id in the comment. I can't tell why you cannot see the issues in the user interface, but first I would try running the tests in the TfsWrapper.Tests project by pointing them to your TFS instance to check whether the communication between the plugin and the server works fine.


I run the test button on the Issue Tracker connection setup and it returns success with the summary of the bug sheet.

I also run TfsWrapper.exe from the command line and seems to be working fine:

TfsWrapper.exe -s=http://myserver:8080 -c=FindMentionsByChangeset 14098 -v
Id: 9566
Url: http://myserver:8080/tfs/web/wi.aspx?id=9566

TfsWrapper.exe -s=http://myserver:8080 -c=GetById 9566 -v
Id: 9566
Summary: Installer - Handle authentication exception better in ServiceChecker
State: Done
Url: http://myserver:8080/tfs/web/wi.aspx?id=9566
Resolved: False

Is there any log I can inspect on TeamCIty to figure out what might be going wrong?

One thing that is not right is the url returned, is that important? For my environment it should be http://myserver:8090/wi.aspx?id=9566


Hi Alex, unfortunately there are no logs. The process BTW is really quite simple, and if the TfsWrapper is working correctly there is not much else which might be going wrong.
One way to debug it is to open Sysinternals' ProcessExplorer and see the TfsWrapper processes being created (and the command lines used). There should be one always active, while others coming and going continuously. The .NET side uses a remoting server to avoid running too many instances connecting concurrently to TFS. It works like this:

  • the TC plugin creates a TfsWrapper process with the appropriate command line arguments
  • the first time TfsWrapper starts it tries to connect to the remoting server, which in this case will not be running, so it starts the remoting server and goes directly to TFS to retrieve the data
  • subsequent requests are proxied through the remoting server

Another option to troubleshoot the process is to try running TfsWrapper in the same way it is run from TC, that is, with the -m=client switch so that is mimics the way it works when invoked from TC, as described above. By default when you run the TfsWrapper process it runs standalone, otherwise; that is, connecting directly to TFS with no remoting server.


OK, so when I run this from the command prompt
TfsWrapper.exe -s=http://cnldev:8080 -c=GetById 9199
it works fine, when I run this
TfsWrapper.exe -s=http://cnldev:8080 -c=GetById 9199 -m=client
I get this error:

System.InvalidOperationException: Sequence contains more than one element
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
   at TfsWrapper.Commands.GetByIdCommand.Execute(TfsConnection tfs, String[] args) in E:\Downloads\temp\tfsteamcity-65320\TfsWrapper\TfsWrapper\Commands\GetByIdCommand.cs:line 19
   at TfsWrapper.TfsWrapper.Execute(TextWriter out, IEnumerable`1 args) in E:\Downloads\temp\tfsteamcity-65320\TfsWrapper\TfsWrapper\TfsWrapper.cs:line 48
   at TfsWrapper.OperationModes.StandaloneOperationMode.Execute(IEnumerable`1 args) in E:\Downloads\temp\tfsteamcity-65320\TfsWrapper\TfsWrapper\OperationModes\StandaloneOperationMode.cs:line 15
   at TfsWrapper.Program.Main(String[] args) in E:\Downloads\temp\tfsteamcity-65320\TfsWrapper\TfsWrapper\Program.cs:line 19

What am I doing wrong? (By the way, I don't see the -m option when I run it with the /? option).


Sorry Alex, I pointed you to the wrong command line switch, it should be -mode=client. And I expect you should get the same behavior.


OK, I tried this switch and it works fine.

I also monitored the processes on the build server using process explorer, I can't see any TfsWrapper process running during normal activity, however when I test the Tfs Issue Tracker connection from AdministrationServer > Configuration I see it for a few seconds as a child process to tomcat6.exe. It then dissappears soon after the result is displayed on the test page. I suppose the test page does not use the "client" switch.

The fact that the test page works suggests that the plugin has been installed succesfully, but somehow it's not invoked when a check in is performed. I tried searching for "tfswrapper" and "TfsIssueTracker" in all the logs but can't find anything relevant.


The processes should indeed pop up as TC calls the executable with the -client switch. Take into account that loading data for the first time from TFS might take quite some time, after which it's cached by the plugin. BTW if you don't see the processes there must be something going wrong, although it's difficult to tell what exactly. The code is straightforward BTW, it should be trivial to instrument.


If you want to perform some tests on a smaller project I suggest you to create, if you don't have one, a project on CodePlex, which provides free TFS server and work item tracking. Point the plugin to the TFS CodePlex instance, create a build on TC, perform a checkin by linking it to a work item and browse the issue list on TC. This would be a smoke test to check if the plugin is just slow or really doesn't work.


Simone, I am not an expert on plugin developement or of Java, but I suppose there is a Java wrapper around the TfsWrapper, do you have any suggestings on how to debug that?

BTW, thank you for developing the plugin helping me out getting it working.


Alex, I'm not an expert in Java nor TC plugin development either, but if you're familiar with C# you will feel comfortable. BTW I don't think you can debug the plugin code itself as it runs inside TC, but you can enable logging, although I'm not sure myself how to do that. You may can ask the TC guys, the plugin is using the standard logging API so enabling it should entail just changing some configuration files.


Please sign in to leave a comment.