Building a .NET application using the GitUpgradeTemplate.xaml

Today I received a request which I first found strange. A team that migrated to Git, but still wanted to use their TFS 2008 era TFSBuild.proj. After seeing the investment made in that build file, I understood :).

So we though to simply use the GitUpgradeTemplate.xaml which is provided with TFS 2013 and be done with it. But you'll see that Team Build will kick off the build and will download your TFSBuild.proj as you'd expect, but it doesn't download your sources.

Your TFSBuild.proj needs to be updated with a few properties to make it work. The minimal project file is listed below:


<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
  <!-- Do not edit this -->
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets" />
  
  <ProjectExtensions>
    <!-- Team Foundation Build Version - DO NOT CHANGE -->
    <ProjectFileVersion>2</ProjectFileVersion>
  </ProjectExtensions>
  <PropertyGroup>
    <!-- Set this property to true for Git build. -->
    <IsGitBuild>true</IsGitBuild>
  </PropertyGroup>
</Project>

In your Build Definition make sure you're using the (rather unfamiliar) vstfs:///Git/VersionedItem/{TeamProject}/{Repository}/{Branch}/{Folder-Containing-TFSBuild.proj} as your Configuration FolderPath.