Partilhar via


How to build an app for Windows Phone 8

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

This topic describes how to build your Windows Phone app in Visual Studio or from the command line.

The output of the build process includes a file with the .XAP extension. The XAP file is a zipped package that contains all the files required by your app. It’s the XAP file that you deploy to the emulator or to a phone, and that you publish to Windows Phone Store.

This topic contains the following sections.

Building a Windows Phone app in Visual Studio

When you’re actively developing your app, you typically create debug builds of the app to support debugging and testing. When you’re ready to submit your app to the Windows Phone Store, you have to create a release build. We recommend that you also create a release build before you use tools such as the Windows Phone Store Test Kit and the Windows Phone Performance Analysis tool.

For more info about the build options in Visual Studio, see Building Applications in Visual Studio.

To specify a debug or release build of a Windows Phone app

  • In Visual Studio, on the Standard toolbar, click the Solution Configurations down arrow, and then select Debug or Release.

    The following image shows the Solution Configurations list box.

To build a Windows Phone app in Visual Studio

  • To build a solution and all the projects in the solution, do one of the following:

    • On the Build menu, select Build Solution or Rebuild Solution.

    • In Solution Explorer, right-click on the solution and select Build Solution or Rebuild Solution.

  • To build a single project in the solution, select the project in Solution Explorer and then do one of the following:

    • On the Build menu, select Build <project name> or Rebuild <project name>.

    • In Solution Explorer, right-click on the project and select Build or Rebuild.

Building a Windows Phone app from the command line

You can also build your Windows Phone app from the command line by using the MSBuild tool. For more info about MSBuild, see the following topics.

To build a Windows Phone app from the command line

  1. Open a command prompt window. If your PATH environment variable doesn’t include the path to MSBuild.exe, navigate to one of the folders that contains this program under C:\Windows\Microsoft.NET\Framework.

  2. Run the MSBuild command and provide at least the fully qualified name of the solution file (.sln) or the project file (.csproj or .vbproj). For example:

    MSBuild D:\Projects\PhoneApp1\PhoneApp1\PhoneApp1.csproj

Precompiling and signing a company app

For info about how to precompile and sign a company app, see How to sign a company app using XapSignTool for Windows Phone.

Building with Visual Studio Team Foundation Build

You can install Windows Phone SDK 8.0 on computers running Windows Server 2012 or Windows Server 2008 R2 to use Visual Studio Team Foundation Build to build existing apps. However, you cannot develop or debug Windows Phone apps on Windows Server editions, even with the Windows Phone SDK installed.

For more info about Team Foundation Build, see Building the Application.

See Also

Other Resources

Windows Phone Emulator for Windows Phone 8

Visual Studio Express 2012 for Windows Phone 8