How to: Update Build Types on Branched Team Projects
Branching with Team Foundation source control copies all the folders and files, including the Team Build Types folder, from a previous branch to a destination branch. For more information, see Branching and Merging Team Foundation Source Control. There are two branching scenarios to consider that affect team build types in different ways:
Partial branch When a team project folder that contains several solutions has only one or some of the solutions branched.
Complete branch When a team project folder is branched in its entirety.
With a partial branch, the build types that are contained in the Team Build Types folder will still be valid for their original configuration. In other words, they will run against the original branch. With a partial branch, it is recommended that new build types are created where needed that point to the solutions in both the original branch and the new branch. For more information, see How to: Create a New Build Type. Although, you could modify the existing TFSBuild.proj files in the new branch to point to the appropriate paths, by creating new build types, you retain the original build types that can still be used on the previous pre-branched configuration.
As with a partial branch, when a complete branch is created within a team project, a copy of the original Team Build Types folder in Team Explorer is made. The build types that are contained in the folder in the new branch will not automatically work against the new branch, as with a partial branch, it will run against the original branch paths. In this case, it is recommended that you modify the paths to the solutions in the TFSBuild.proj files to point to the correct folder, as described in the following procedure.
Required Permissions
To update build types on branched team projects, you must have the have the Administer a build permission set to Allow. Additionally, you need the Check out permission set to Allow for the Team Build Types folder. For more information, see Team Foundation Server Permissions.
Procedure
To edit a TFSBuild.proj file to updated build type paths because of a complete branch operation
To edit an existing build type to update the path to the solution, the corresponding TFSBuild.proj file must be checked out. For more information, see Getting a Local Copy of Files from the Source Control Server and How to: Edit a Build Type.
Right-click the TFSBuild.proj file in source control and click Check Out for Edit.
Double-click the TFSBuild.proj file to open it in Visual Studio.
In the TFSBuild.proj file, locate the <ItemGroup> tag. Within the <ItemGroup> tag, update the path in each SolutionsToBuild tag, as shown in the following example.
Original file copied from Team Project Folder Alpha:
<ItemGroup> <SolutionToBuild Include="$(SolutionRoot)\Alpha\path\Solution1.sln" /> <SolutionToBuild Include="$(SolutionRoot)\Alpha\path\Solution2.sln" /> </ItemGroup>
Modifications to reflect new branched called Beta1:
<ItemGroup> <SolutionToBuild Include="$(SolutionRoot)\Beta\path\Solution1.sln" /> <SolutionToBuild Include="$(SolutionRoot)\Beta\path\Solution2.sln" /> </ItemGroup>
Save the TFSBuild.proj file and check it in to source control. Modifications to the updated paths in the file will affect the build type moving forward.