Thursday 3 May 2012

My battle with TFS 2010 Custom Activity (1)

I am sure by now you have seen the TFS 2010 build template. Pretty cool!

Normally if you build a solution is Visual Studio, the binaries can be found under the "bin" folder of each project. But if you notice the binaries coming out of a TFS 2010 build agent is dropped into a central location.

Some argue that this is a good solution. If you consider the references between project, having a folder for each project is very costly. The binaries can easily be duplicated over projects.

I recently had to make changes to the build process so that each project is built and dropped to a project specific folder. You might say that, surely TFS 2010 should support this level of customisation. But unfortunately this is far from being true.

I spend a whole day trying to figure out how to do this. Following are some solutions that I came across.


  1. Update to the Build Template Only
  2. Update to build template and each project in the solution


But my constrains were, no changes to the projects in the solution. Therefore solution (2) is out of the equation.

My expectation is below:

Drop folder/
               Project1
                    One.dll
                    Two.dll
              Project 2
                    Three.dll

The solution (1) is very promising but error prone. What if there are multiple solutions in the same workspace each using different projects? Then this method fails too.

So I am left is only a single solution, write my own custom activity.

My strategy is simple, build each project into their respective "bin" folders and copy the contents of the "bin" folder them across to the drop folder (under each project folder).

That is where the fun begin! (next post)

No comments:

Post a Comment