Project Description
Programmatically create and provision a new TFS Team Project. Developed for VS/TFS 2010, but can be adapted for VS/TFS 2008.

All feedback is welcome!


As the TFS administrator, I've always wanted a customized tool for creating and provisioning new Team Projects, rather than just using the Team Explorer dialogs. Not only do I need the project names to have a specific syntax (we require some minimal metadata in the name), but there are also repetitive tasks (establishing Group Membership security, etc.) that every new Project requires.

Certainly there must be a Team Foundation API that I can use to create new Projects programmatically -- doh! There isn't one.

What there is, currently, is a client-side Team Explorer command called "File.BatchNewTeamProject", which is barely documented, and a bit awkward to use: you code up an XML file that describes your Project, and pass it to BatchNewTeamProject as an argument. But even this is only a partial solution (your XML file is just a replacement for the "New Team Project..." wizard dialogs) -- you still can't automate the entire provisioning process.

My goal in this project was two-fold:
1) Produce a .Net assembly that encapsulated all the fiddly code necessary to generate the required XML file and invoke BatchNewTeamProject.
2) To write a shop-specific provisioning tool that not only created Team Projects, but also did the necessary post-creation tasks that I needed.

Goal #1 is realized by the "TfsProjectTools" assembly, which you can use to write your own custom provisioning tool.
Goal #2 is presented here as a desktop app, "TfsProjectProvisionerCodeplex"; this is a simplified version of the tool I wrote for myself, with most of the shop-specific details removed. You can use this as a sample and a starting-point for your own tool.

Last edited May 16, 2011 at 11:05 PM by brad_kaenel, version 2