Get Files Associated with a Build

One of the greatest features of Team Foundation Server is it's extensibility via the TFS Object Model.  A short while back I received a question asking how to retrieve a list of all files included in all the changesets associated with a build.  The intent (of the person asking the question) was to deploy only those files that had been modified in one of the changesets. The following code example is what I came up with.  I can't say it's the only way, or even the most efficient way, to achieve the desired result, but it's at least one way…
Read More

Creating Team Build Types

I was answering a question related to programmatically creating team build types today and realized there weren’t too many examples on the web.  I didn’t see any examples that included all the details I was looking for – for example: Adding the solution to be built to the new build type Turning on/off test execution Turning on/off code analysis An example containing these details may exist, I just didn’t come across it during my initial search. So, with that said, I decided to post the main part of the example application I put together to test out some concepts.  The…
Read More

MSDN Code Gallery

Although it's been about two weeks since Microsoft launched its new MSDN Code Gallery, I am just now getting around to checking it out. At first glance, it appears there are quite a few similarities between the MSDN Code Gallery and Microsoft's CodePlex site (another open source site provided by Microsoft and hosted on top of Team Foundation Server).  So, what are the differences between the two sites?  Basically, it boils down to project management: Microsoft's CodePlex site is suited for open source projects requiring some level of project management whereas the MSDN Code Gallery is mainly an on-line repository…
Read More

Programmatically Download Attachments from TFS

I created this short snippet of code the other day in reference to a forum question on how to retrieve the linked items for a given work item.  The code below uses the TFS Object Model to retrieve a specific work item (in this case, item #16) and save all attachments to the local file system. Code Snippetusing Microsoft.TeamFoundation.Client;using Microsoft.TeamFoundation.Server;using Microsoft.TeamFoundation.WorkItemTracking.Client;using System;using System.IO;namespace DTTFSLib{public class WorkItemTest {public WorkItemTest(string serverName) {// Connect to the desired Team Foundation Server TeamFoundationServer tfsServer = new TeamFoundationServer(serverName);// Authenticate with the Team Foundation Server tfsServer.Authenticate();// Get a reference to a Work Item Store WorkItemStore workItemStore =…
Read More