doc/articles/uno-publishing-windows-packaged-signed.md
This guide will show how to create a signed packaged app using Windows App SDK.
[!IMPORTANT] Building your app requires using the msbuild command (
dotnet buildis not compatible as of WinAppSDK 1.5).
This guide uses a self-signed certificate.
To package your app:
Create a self-signed certificate:
net10.0-windows10.0.xxxxxPackage.appxmanifest filePackaging tabNavigate to the folder of the app's .csproj (Building at the solution level is not supported)
Build the app on the command line with the following command:
# For .NET 9:
msbuild /r /p:TargetFramework=net9.0-windows10.0.26100 /p:Configuration=Release /p:Platform=x64 /p:GenerateAppxPackageOnBuild=true /p:AppxBundle=Never /p:UapAppxPackageBuildMode=Sideloading /p:AppxPackageDir="C:/temp/output/" /p:AppxPackageSigningEnabled=true
# For .NET 10:
msbuild /r /p:TargetFramework=net10.0-windows10.0.26100 /p:Configuration=Release /p:Platform=x64 /p:GenerateAppxPackageOnBuild=true /p:AppxBundle=Never /p:UapAppxPackageBuildMode=Sideloading /p:AppxPackageDir="C:/temp/output/" /p:AppxPackageSigningEnabled=true
To package your app for the Microsoft App Store, the process is similar to creating a self-signed app package with just a minor difference:
Instead of linking to a self-signed certificate, associate your project with a Microsoft Store Application by right-clicking on your project in the solution explorer, then the Publish, Associate App with Store... menu item.
Build the app on the command line with the following command:
msbuild /r /p:TargetFramework=net10.0-windows10.0.26100 /p:Configuration=Release /p:Platform=x64 /p:GenerateAppxPackageOnBuild=true /p:AppxBundle=Never /p:UapAppxPackageBuildMode=StoreUpload /p:AppxPackageDir="C:/temp/output/"
In order to build for additional platforms, change the Platform parameter to x86 or arm64 to create additional MSIX files.
[!IMPORTANT] Single package msix bundling is not yet supported from msbuild the command line. The individual msix packages can be assembled after creation using Microsoft's
makeappx.exetool installed with the Windows SDK in 'Windows Kits' folder, for exampleC:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\makeappx.exe.
To bundle the individual msix packages, move them all to a common folder, for example, "C:\Temp\Output\MyApp", and run the following command:
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\makeappx.exe" bundle /d "C:\Temp\Output\MyApp" /p "C:\Temp\Output\MyApp.msixbundle"
[!TIP] The
makeappx.exetool is also available from the environment when opening a Developer Command Prompt for VS 2022
If your app references multiple library projects, you will need to split the above build command into two parts, one to restore NuGet packages, and the other one to create the package.
To build your solution:
Add the following to your app's csproj:
<PropertyGroup Condition=" '$(PublishSignedPackage)' == 'true' ">
<GenerateAppxPackageOnBuild>true</GenerateAppxPackageOnBuild>
<AppxBundle>Never</AppxBundle>
<UapAppxPackageBuildMode>Sideloading</UapAppxPackageBuildMode>
<AppxPackageSigningEnabled>true</AppxPackageSigningEnabled>
</PropertyGroup>
Run this command to restore the NuGet packages:
msbuild /r /t:Restore /p:Configuration=Release
Then run this command:
msbuild /p:TargetFramework=net10.0-windows10.0.26100 /p:Configuration=Release /p:Platform=x64 /p:PublishSignedPackage=true /p:AppxPackageDir="C:/temp/output/"
Notice that this command does not contain the /r.
To install the app:
.msix file, then Show More Options on Windows 11, then Properties.msix by double-clicking on itThe app will start automatically once installed.