Create a packaged app

Overview

A packaged app bundles all of the resources, binaries, and dependencies required to run on Windows. With the Windows App SDK you can create modern desktop apps that are fully packaged and distributed through Microsoft Store or side‑loaded.

Prerequisites

  • Windows 10 version 1809 or later
  • Visual Studio 2022 (17.8+) with the Desktop development with C++ or .NET desktop development workload installed
  • Windows App SDK 1.3+ downloaded and installed

Step‑by‑step guide

  1. Create a new project

    Open Visual Studio → File → New → Project → search for Windows App SDK and choose Blank App (C#) or Blank App (C++).

    dotnet new winui3 -n MyPackagedApp
  2. Add the app package manifest

    In Solution Explorer, right‑click the project → Add → New ItemApp Package Manifest (Package.appxmanifest). Edit the manifest to set the display name, version, and capabilities.

  3. Configure the app to be packaged

    Open the project file (.csproj or .vcxproj) and ensure the following properties are set:

    <Project Sdk="Microsoft.NET.Sdk">
      <PropertyGroup>
        <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
        <OutputType>WinExe</OutputType>
        <GenerateAppxPackageOnBuild>true</GenerateAppxPackageOnBuild>
        <PackageCertificateKeyFile>MyCert.pfx</PackageCertificateKeyFile>
      </PropertyGroup>
    </Project>
  4. Build and package

    From the Build menu select Build Solution. The generated .msix package can be found in bin\Debug\AppPackages.

  5. Test the package

    Double‑click the .msix file to install locally, then launch the app from the Start menu.

Common pitfalls

IssueResolution
Missing capabilities in manifestAdd required capabilities (e.g., internetClient) via the manifest designer.
Package signing errorCreate a self‑signed certificate and reference it in the project file.
App fails to launch after side‑loadingEnsure the target Windows version in TargetFramework matches the OS.

Next steps