Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Packaging is an important part of any Windows App SDK project. For details on your options, see Advantages and disadvantages of packaging your app.
If you choose to unpackage a new or existing WinUI app, follow these steps:
In your .csproj file, find the first existing PropertyGroup element, which also contains OutputType, TargetFramework, and other properties.
- Add the
WindowsPackageTypeproject property to this PropertyGroup element. Set its value toNone.
<Project ...>
...
<PropertyGroup>
<WindowsPackageType>None</WindowsPackageType><!-- add this -->
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
...
</PropertyGroup>
...
</Project>
To start the app from Visual Studio (either Debugging or Without Debugging), select the Unpackaged launch profile from the Start drop-down. If the Package profile is selected, then you'll see a deployment error in Visual Studio. This step isn't necessary if you start the application (.exe) from the command line or from Windows File Explorer.
The bootstrapper API
Setting the <WindowsPackageType>None</WindowsPackageType> project property causes the auto-initializer to locate and load a version of the Windows App SDK that's most appropriate for your app.
If you have advanced needs (such as custom error handling, or to load a specific version of the Windows App SDK), then you can instead call the bootstrapper API explicitly. For more info, see Use the Windows App SDK runtime for apps packaged with external location or unpackaged, and Tutorial: Use the bootstrapper API in an app packaged with external location or unpackaged that uses the Windows App SDK.
For more info about the bootstrapper, see Deployment architecture and overview for framework-dependent apps.
Windows developer