Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Walkthrough: Creating a Build Type in Team Foundation Build

This walkthrough demonstrates how to configure a build type for Team Foundation Build. Prior to starting this walkthrough, it is important to have some basic knowledge of Team Foundation Build. For more information, see Managing Builds with Team Foundation Build.

In this walkthrough, you step through the process of configuring a build type using the New Team Build Type Wizard. You will also establish the permissions required for the build machine and the users who will run the build types created. In this walkthrough, you will complete the following tasks:

  • Create a new build type.

  • Select the solutions to build.

  • Select a build machine and drop location.

  • Select build steps.

  • Select a configuration and platforms for build.

  • Establish permissions on the build machine.

  • Establish permissions for specified users to be able to run the build type created.

Required Permissions

To complete this walkthrough, you must have the Team Foundation Server administer a build permission and the Team Foundation Server start/resume a build permission. For more information, see Team Foundation Build Security Rights and Permissions.

To create a new build type

  1. On the Build menu, select New Team Build Type, the New Team Build Type Creation Wizard displays.

  2. In the New Team Build Type Creation Wizard, specify the name to associate with the build type in the What do you want to name this team build type text box.


    You must have the Team Foundation Server administer a build security permission in order to create a build type. For more information, see Team Foundation Build Security Rights and Permissions.


    A validation is made to check if the name entered already exists for an established build type. If the name exists, you are prompted to enter a unique name. The build type name must be a valid Windows filename and cannot contain $.

    Add an appropriate description in the Description text box and click Next to proceed, the Select and order solutions to build step displays.


    The Next button is only enabled when all mandatory fields are properly completed.

  3. In the drop-down list box below From which workspace would you like to select solutions to build, select the workspace containing the solutions that you wish to include in the build type. The drop-down option shows the workspace name and the user who created it.

  4. In the Select and order solutions listing, check the solution or solutions that you want to add to the build type.

  5. Select the solutions and change their location in the build order using the arrow buttons to the right of the list. Solutions are built in order, starting at the top of the list.


    Be aware of one solution having dependencies on another when determining the order in which they are built. For example, set Solution1 to be built before Solution2 in the case where Solution2 has a dependency on Solution1.

  6. When you are satisfied with the solutions that you have selected and the order in which they are specified to build, click Next, the Select configurations to build step displays.

  7. In the grid under Which project configurations would you like to build, select the desired configuration and platforms to include in the build. The build configuration indicates the configuration and platform desired (for example, Retail and AnyCPU).

  8. When you are satisfied with the build configuration selections, click Next, the Select build location step displays.

  9. In the text box for On which machine would you like to build, type the machine name, for example MachineA_Lab1.

  10. In the text box for Build directory on selected machine, enter the directory where you want the build to take place. This is a local directory on the build machine. For example, D:\AdventureWorks\TourPackageServices\.


    When selecting the build directory, ensure that there is enough space to build, insufficient space will lead to failed builds.

  11. In the text box for Drop Location, either type in the UNC (\\server\share) location. The drop location is where the built binaries and log files will be located once the build completes.

    Caution noteCaution

    By default, the drop directory is not automatically created as a share and therefore is not accessible for publishing builds and tests results. You must manually establish a share, add write permissions to the Windows directory, and add share permissions for both the account used to run Team Foundation Build service for dropping builds and for the tester's account for publishing test results.


    Each generated build will be dropped into a separate directory. You will need to ensure that the account with which build machine is configured has write access to this UNC location.

  12. When you are satisfied with the build location settings, click Next, the Select Build Options step displays.

  13. Indicate the build options that you want to enable by clicking the Run test (e.g. run BVTs, etc.) and Perform code analysis check boxes as appropriate. If the Run test (e.g. run BVTs, etc.) check box is selected, use the drop-down options to specify the Test metadata file and Test list to run as appropriate. For more information, see Using Test Lists and Writing Quality Code.

  14. When you are satisfied with the build steps, click Next, the Review Build Type selections step displays.

  15. If you are satisfied with the build type, click Finish, the new build type creates the underlying files. The files created are:

    • TfsBuild.proj

    • WorkspaceMapping.xml

    These files are checked into Team Foundation source control under the folder with the same name as "build type." For example, if you create a build type named "myBuildType," in Team Foundation source control, the files get stored at $/[Team Project Name]/TeamBuildType/myBuildType.


    If you want to further edit the build type, you will need to edit the TfsBuild.proj file.

    With the Build Type Wizard steps completed, you must now ensure that the Team Foundation Build Service on the selected build machine has the required permissions to build this team project. You must also give the proper permissions to users who will run the build type. Establishing these permissions is discussed in the following procedure.

To establish build permissions

  1. Contact the system administrator for the previously selected build machine to determine the name of the account under which the Team Foundation Build Service is running.

  2. From Team menu, select Team Project Settings, and then select Group Memberships. The Project Groups dialog box appears.

  3. In Project Groups, under the Users and Groups listing, find the group called Build Services, and click Properties. The Team Foundation Server Group Properties dialog box appears.

  4. Select the Members tab. If the account obtained in the preceding step is present in the member list, then the selected build machine can build this build type. Otherwise, use the following steps:

    1. In the Add member section, choose Windows User or Group, and click Add. The Select Users or Groups dialog box appears.

    2. In Select Users or Groups dialog box, enter the account associated with the Team Build Service on the build machine used for this build type.


      If this build type is built on multiple build machines, then all of the Team Build Service accounts need to be added as members of this project's 'Build Services' group.

  5. Configure which users are to run build types by granting them the start/resume a build permission. For more information, see Auditing and User Permissions and Team Foundation Build Security Rights and Permissions.

Community Additions

© 2015 Microsoft