Modifying the TFS build workflow can be tricky. This is due to the fact that you need to reference a bunch of VS private DLLs to get the project to build. This package installs into a .net project and adds all of the references needed to update and compile a TFS 2010 build workflow.
VersionTasks is an MSBuild Tasks library to automatically insert the current repository's changeset into to your project. Supports Git, Mercurial, Team Foundation Server 2010 and Team Foundation Server 2012.