Freigeben über


Build and test a Windows Store app using Team Foundation Build

You can use Team Foundation Build to compile and test a Windows Store app.

  • Deploy a build agent that can compile Windows Store apps

    • Deploy the build agent

    • Apply a tag to the build agent

    • Enable your build agent to run unit tests

  • Define a build process that builds and tests Windows Store apps

  • Use older build process templates

  • Q & A

Deploy a build agent that can compile Windows Store apps

Tip

Is your team project hosted on Visual Studio Online? If you do not need to run unit tests, you might be able to skip deploying your own build agent and instead use a hosted build controller.

Required permissions

You must be a member of the Administrators group on the build server and your Manage build resources permission must be set to Allow. For more information, see Permission reference for Team Foundation Server.

Deploy the build agent

  1. Locate or install a build server and configure a build agent on a computer that is running Windows 8.1.

  2. Install Visual Studio on the build server. In most cases, you can install the same version of Visual Studio that your team uses on its dev machines.

    In a few cases, you must install Visual Studio Professional, Visual Studio Premium, or Visual Studio Ultimate:

    See Installing Visual Studio.

  3. From Windows Start, run Team Foundation Server Administration Console.

    The Team Foundation Server Administration Console appears.

  4. In the tree pane, expand the name of the server, and then choose the Build Configuration node.

    Information about the build server appears in the content pane. If the Configure Installed Features link appears, you must complete the initial configuration of the build server. See Set up Team Foundation Build Service.

Build Server Administration Console

Apply a tag to the build agent

One way to make sure that your build process runs only on a build agent that is capable of compiling and testing Windows Store apps is to apply a tag to the build agents.

  1. In the Build Configuration node of the Team Foundation Server Administration Console, complete one of these steps:

    • Choose New Agent.

    • Locate a build agent that you want to use to build your Windows 8.1 apps, and then choose its Properties link.

  2. The Build Agent Properties dialog box appears.

  3. Under Tags, choose the Add new tag link.

    The Add New Tag dialog box appears.

  4. Specify a tag, such as WindowsStore.

Tag the build agent

If you need to run unit tests, continue to the next section. Otherwise, you can skip to Define a build process that builds and tests Windows Store apps.

Enable your build agent to run unit tests

You can enable your build agent to run unit tests on your Windows Store app.

  1. Identify a user account (not NETWORK SERVICE) that you will use as the build service account. The build service account must meet these criteria:

  2. Log on to the build server with your build service account credentials.

  3. In the Build Configuration node of the Team Foundation Server Administration Console, choose Properties.

    Select Properties

    The Build Service Properties dialog box appears.

    Run the build service as an interactive process

  4. Choose Stop the service.

  5. Under Run the Service as, choose Change, and then specify the credentials to your build service account.

  6. Select Run the Service interactively.

  7. Choose the Acquire button to install a developer license.

  8. Choose the Manage button to generate a certificate or to select one that you have already generated.

  9. Choose Start, and then choose OK.

  10. Leave the build service account logged on to the build server.

Define a build process that builds and tests Windows Store apps

To build (and optionally test) a Windows Store app, you must apply a few settings in your build definition. The following procedure describes how to define a build process that is based on the Default Template.

Required Permissions

To complete the following procedure, you must have the Edit Build Definition permission set to Allow. For more information, see Permission reference for Team Foundation Server.

To define a build process that builds and tests Windows Store apps

  1. In Team Explorer, make sure you are connected to the team project (Keyboard: Ctrl + 0, C), and then open the Builds page (Keyboard: Ctrl + 0, B).

  2. Choose the New Build Definition link or select a build, open its shortcut menu, and choose Edit Build Definition.

    Tip

    If a TF225001 error message appears, configure a build controller.

  3. On the Build Defaults tab, select the build controller that pools a build agent that you have deployed to build Windows Store apps, as explained previously in this topic.

    Specify the staging location option you want. See Select a staging location and set up a drop folder.

  4. On the Process tab:

    1. In the Build node in the Projects box, specify one or more solutions or projects to build.

    2. In the Advanced node, in the Agent Settings sub-node, in the Tags Filter box, specify the tag that you applied to build agents that you are using to build Windows Store apps, for example, WindowsStore.

  5. If you want to run automated unit tests, follow these steps on the Process tab in the Test node:

    1. Select the Automated Tests box, and then choose the ellipsis button (...).

      The Automated Tests dialog box appears.

    2. Complete one of these steps:

      • To add a test run, choose Add.

      • To modify a test run, choose it, and then choose Edit.

      The Add/Edit Test dialog box appears.

    3. On the Test runner menu, choose Visual Studio Test Runner.

    4. In the Test assembly file specification box, type **\*test*.dll;**\*test*.appx.

    5. For information about other settings, see Run tests in your build process.

  6. Specify any other settings that your build process requires. For more information, see Create or edit a build definition.

Use older build process templates

If your build process template is from an earlier version of TFS, you will need to modify your template if you want to build a Windows 8.1 app. See Use an earlier build process template to build some kinds of apps.

Q & A

Q: How do I develop my Windows Store app?

A: See Learn to build Windows Store apps.

Q: How do I create and run unit tests on my Windows Store app?

A: See Walkthrough: Creating and Running Unit Tests for Windows Store Apps.

Q: How do I validate my Windows Store app?

A: See Validating an app package in automated builds