Build your Universal Windows Platform app

Last Update: 3/6/2017

Team Services | TFS 2017 | TFS 2015 | Previous versions: XAML Build, Release

Upload your code

Upload your code to Visual Studio Team Services or your on-premises Team Foundation Server. Either push your code to Git or check in your code to TFVC.

You must also upload your .pfx certificate file. For example if you are working in a Git repo:

C:\Users\YourName\Source\Repos\Universal>git add App1\App1\App1_TemporaryKey.pfx -f

Define your CI build

Your CI build compiles your app into native code so you can run and test the app on your device.

Create the definition

  1. Open your team project in your web browser ▼

    Browse to team project

    (If you don't see your team project listed on the home page, select Browse.)

    • On-premises TFS: http://{your_server}:8080/tfs/DefaultCollection/{your_team_project}
    • Visual Studio Team Services: https://{your_account}.visualstudio.com/DefaultCollection/{your_team_project}

    The TFS URL doesn't work for me. How can I get the correct URL?

  2. Create a build definition (Build & Release tab > Builds) ▼

    Build tab

  3. On the Create new build definition dialog box, select Universal Windows Platform ** and click Next.
  4. Select the repo, branch, and **continuous integration.

Modify the build step

On the Build tab:


Visual Studio Build

Build your app.

  • MSBuild Arguments: Leave it set to the default:

    /p:AppxBundlePlatforms="$(BuildPlatform)" /p:AppxPackageDir="$(Build.BinariesDirectory)\AppxPackages\" /p:AppxBundle=Always
    

    Q: Why do I need these arguments? A:

    • /p:AppxBundlePlatforms="$(BuildPlatform)" The template is setup with BuildPlatform="x86|x64|ARM" so the bundle will include all three platforms.
    • /p:AppxPackageDir="$(Build.BinariesDirectory)\AppxPackages\\" Location where the bundle directories are created.
    • /p:AppxBundle=Always Always produce a bundle.
  • Platform: Leave it blank. (The bundle platforms are specified in the above MSBuild Arguments.)
  • Configuration: Leave it set to $(BuildConfiguration)

    Note: By default BuildConfiguration is set to release on the Variables tab. With the Universal Windows Platform, there is now a new native compiler that will improve the runtime performance of your app. With this change, it is highly recommended that you test your app in this compilation environment. By default, the Release build configuration enables the .NET native toolchain, so it is important to test your app with this Release configuration and check that your app behaves as expected.

Define your publication build

Your publication build compiles your app into an appxupload file that the store needs to offer your app to customers.

Create the definition

Create another build using the Universal Windows Platform template.

Modify the build step

On the Build tab:


Visual Studio Build

Build your app.

  • MSBuild Arguments: Add a switch to the default setting.

    /p:AppxBundlePlatforms="$(BuildPlatform)" /p:AppxPackageDir="$(Build.BinariesDirectory)\AppxPackages\" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload
    

    Q: Why do I need these arguments? A:

    • /p:AppxBundlePlatforms="$(BuildPlatform)" The template is setup with BuildPlatform="x86|x64|ARM" so the bundle will include all three platforms. All three platform should be included when creating an appxupload file.
    • /p:AppxPackageDir="$(Build.BinariesDirectory)\AppxPackages\\" Location where the bundle directories are created.
    • /p:AppxBundle=Always Always produce a bundle.
    • /p:UapAppxPackageBuildMode=StoreUpload Produces an appxupload file.
  • Platform: Leave it blank. (The bundle platforms are specified in the above MSBuild Arguments.)
  • Configuration: Leave it set to $(BuildConfiguration)

    Note: By default BuildConfiguration is set to release on the Variables tab. Release should be used for upload builds.

Finish and test the definition

  1. On the Repository tab:

    • Git: Make sure the repository and branch containing your application are selected. (By default the repository with the same name as the team project is selected.)

    • TFVC: Make sure the folder that contains your app is mapped.

  2. On the Triggers tab select continuous integration (CI). If your code is in Git, specify the branches you want to build.

  3. Save your definition and queue the build.

Q&A

How do I associate my package with the store?

See Packaging Universal Windows apps for Windows 10.

I use Team Foundation Server on-premises and I don't see some of these features. Why not?

Some of these features are available only on Visual Studio Team Services and not yet available on-premises. Some features are available on-premises if you have upgraded to the latest version of TFS.