Udostępnij za pośrednictwem


Create and Work with a Custom Build Process Template

If the build definitions you can create by using the Default Template or the Upgrade Template do not meet your team's needs, you can create your own richly customized build process template.

This topic includes the following sections:

  • Create a New Build Process Template

  • Register a Build Process Template with the System

  • Working with Build Process Templates

Required Permissions

To perform the following procedures, you must have the Edit Build Definition permission set to Allow. For more information, see Team Foundation Server Permissions.

Create a Build Process Template

To create a custom template

  1. In Team Explorer, select a team project.

  2. On the Build menu, click New Build Definition.

  3. Type a name in the Build definition name field.

  4. Click the Process tab, click Show details, and then click New.

    The New Build Process Template dialog box appears.

  5. Click Copy an existing XAML file, and then click OK.

  6. In the build definition window, below the Build process file menu, click the hyperlink that contains the name of your template.

    The folder that contains your new template appears in Source Control Explorer.

  7. In the Folders pane, right-click the folder that contains your new template and click Get Latest Version.

  8. Right-click your new template and click View.

    The Workflow Designer appears.

  9. In the Workflow Designer, edit your template.

  10. After you have finished editing your template save it and close the designer.

  11. Right-click your new template and click Check In Pending Changes.

    The Check In dialog box appears.

  12. Click Check In.

Register a Build Process Template with the System

You can register build process templates created outside your team project. For example, you may have received a build process template from a colleague in e-mail and checked it into the TeamBuildProcessTemplates folder in your team project's version control system.

Before you and others on your team can use the build process template to create build definitions, you must register it with the system.

To register a build process template with the system

  1. In Team Explorer, select a team project.

  2. On the Build menu, click New Build Definition.

  3. Type a name in the Build definition name field.

  4. Click the Process tab, and then click New.

    The New Build Process Template dialog box appears.

  5. Click Select an existing XAML file.

  6. Click Browse.

    The Browse dialog box appears.

  7. Use the Browse dialog box to locate and select the custom template that you want to register.

    Your new build process template is now displayed in the Build process file list and can be used by you or others on your team to create build definitions.

Working with Build Process Templates

Following are some recommendations and tips that can help you be more successful in working with build process templates:

  • The Team Foundation Build activities are the fundamental components of the build process. You can re-use these activities to create a custom build process. For more information, see Team Foundation Build Activities.

  • We recommend that you do not modify the Default Template or the Upgrade Template. Instead, create a template based on one of these templates, as described in Create a New Custom Build Process Template.

  • You can register a build process template with more than one team project. This capability means that you can share a build process across any team project in the team project collection that contains your template.

  • If you need to modify a build process template, you should plan to review all build definitions that are based on the template and correct them after you have completed your changes to the build process template. If you do not do this, your build definitions may fail or function in an unexpected way.

  • If you decide to delete a build process template, first make sure that you locate and delete all build definitions that are based on the template. When you delete the template, any remaining build definitions based on the template will no longer function.

  • For general information about how to use the Workflow Designer, see the following pages on the Microsoft website: