How to: Edit a Build Type
Prior to editing a build type, you must first create a build using the New Team Build Type Creation Wizard, for more information, see. After a build type has been created, the build type will include an associated TFSBuild.proj file which is created and checked into Team Foundation source control under $<Team Project>\TeamBuild Types\<Build Type Name>\TFSBuild.proj. To edit the Build Type, the TFSBuild.proj file must be modified. The following procedure demonstrates how to edit a build type TFSBuild.proj file.
To perform this procedure, you must have the Administer a build security permission set to Allow. Additionally, you must have the Check in permission set to Allow for the Team Build Types folder. For more information, see.
To edit a build type TFSBuild.proj file
To edit an existing build type, the corresponding TFSBuild.proj file needs to be checked out. For more information, see.
Right-click the TFSBuild.proj file and click Check Out for Edit. Once you have checked the file out for edit, double-click the file to open it in Visual Studio.
In the TFSBuild.proj file, locate the Description section. If desired, edit the description by modifying the value in the Description element, for example:
<Description>This is my new description</Description>
Locate the SolutionToBuild element. For every solution that you want to include in the build type, a new SolutionToBuild element inside the ItemGroup element must be created. This specifies the solution name using the Include attribute, for example:
<ItemGroup> <SolutionToBuild Include="$(SolutionRoot)\path\MySolution.sln /> <SolutionToBuild Include="$(SolutionRoot)\Scribble\scribble.sln" /> <SolutionToBuild Include="$(SolutionRoot)\HelloWorld\HelloWorld.sln" /> <SolutionToBuild Include="$(SolutionRoot)\TestProject1\TestProject1.sln" /> </ItemGroup>
Locate the SolutionToBuild element. The order of the solutions is changed by modifying the order of the solutions specified in the ItemGroup element as described in the preceding step. If you need to move the HelloWorld solution above the Scribble solution as shown in the preceding step, make the following modifications:
<ItemGroup> <SolutionToBuild Include="$(SolutionRoot)\TestProject1\TestProject1.sln" /> <SolutionToBuild Include="$(SolutionRoot)\HelloWorld\HelloWorld.sln" /> <SolutionToBuild Include="$(SolutionRoot)\Scribble\scribble.sln" /> </ItemGroup>
Locate the ConfigurationToBuild element. To add a new combination of configurations for debug and retail and platforms such as x86 and Itanium, add elements to the Compile target as shown below. In this example the user has a new combination of Debug and x86.
<ConfigurationToBuild Include="Release|x86"> <FlavorToBuild>Debug</FlavorToBuild> <PlatformToBuild>x86</PlatformToBuild> </ConfigurationToBuild>
Locate the BuildMachine element. The build machine can be modified by editing the BuildMachine element, for example:
Locate the BuildDirectoryPath element. The build directory is modified by editing the BuildDirectoryPath element, for example:
Locate the Drop Location element. The drop location is modified by editing the DropLocation element, for example:
Locate the RunTest element. To modify the option of enabling test in the build process, edit the value of the RunTest element which can have either a true or false value, for example:
If you want to run selective tests, you can specify them with a Condition attribute. For example if you want to run the test for only "Debug|Any CPU" configuration, modify the corresponding MetaDataFile item and add the following condition:
<MetaDataFile Condition = ” ’$(Platform)’ == ’Any CPU’ and ‘$(Flavor)’ == ’Debug’ ” Include = ”$(SolutionRoot)\HelloWorld\HelloWorld.vsmdi”> <TestList>BVT1</TestList> </MetaDataFile>
For more information on test metadata files, see
Locate the RunCodeAnalysis element. To change the option of enabling code analysis in the build process, modify the value of the RunCodeAnalysis element with Default, Always or Never value, for example:
Save and check in the TFSBuild.proj file. Modifications to the file will affect the build type moving forward.