npx skills add ...
npx skills add microsoft/win-dev-skills --skill winui-packaging
MSIX packaging, code signing, and distribution for WinUI 3 apps — build for release, certificate generation (winapp cert generate), certificate trust, code signing (winapp sign), self-contained deployment, CI/CD with GitHub Actions, and Microsoft Store submission. Use when preparing for release, creating MSIX installers, managing certificates, setting up CI/CD packaging, or publishing to the Microsoft Store.
npx skills add microsoft/win-dev-skills --skill winui-packaging
| Task | Command |
|---|---|
| Build for release | .\BuildAndRun.ps1 . -c Release --arch x64 --no-launch |
| Package + sign | winapp package <dir> --cert devcert.pfx |
| Generate + sign + package | winapp package <dir> --generate-cert --install-cert |
| Generate dev certificate | winapp cert generate |
| Trust certificate (admin) | winapp cert install ./devcert.pfx |
| Sign existing file | winapp sign ./app.msix ./devcert.pfx |
| Self-contained deployment | winapp package <dir> --cert devcert.pfx --self-contained |
Build the project in Release configuration without launching it. Use the BuildAndRun.ps1 wrapper from the winui-dev-workflow skill — plain dotnet build does not load the bundled Microsoft.WindowsAppSDK.Analyzers, so release builds would ship without the analyzer gate that development builds get:
--no-launch builds and registers a development package without starting the app. Run winapp unregister before installing the signed .msix in Step 5, so the development registration does not conflict with the packaged identity.
Creates devcert.pfx (default password: password). The --manifest flag auto-matches the Publisher field in Package.appxmanifest.
Adds cert to machine Trusted Root store. Persists across reboots.
This locates appxmanifest.xml, stages the layout, generates resources.pri, creates .msix, and signs it.
Identity.Publisher — use winapp cert generate --manifest to auto-matchwinapp package --cert over separate winapp sign — one step instead of twocert install requires admin — run terminal as Administratorpassword — override with --password--timestamp is critical for production — without it, signatures expire with the cert:
--self-contained bundles Windows App SDK runtime — larger but no runtime dependencyCI/CD tips:
dotnet build on the runner, not BuildAndRun.ps1 — the wrapper registers a development package and needs the plugin's local analyzer payload, neither of which belongs in CI. Enforce analyzer coverage on the dev machine instead.--quiet for clean output--if-exists skip with cert generate to avoid failures on re-runs.msix / .msixbundle produced by winapp package via Microsoft Partner Center — Apps and games → your app → Packages. Microsoft Store submission is browser-based; there is no first-party CLI submit command yet.| Error | Solution |
|---|---|
| "Publisher mismatch" | Run winapp cert generate --manifest to re-generate |
| "Certificate not trusted" | Run winapp cert install ./devcert.pfx as admin |
| "Access denied" | cert install needs admin elevation |
| "Certificate file already exists" | Use --if-exists overwrite or --if-exists skip |
| "appxmanifest.xml not found" | Run winapp init or pass --manifest <path> |
| "Package installation failed" | Trust cert first; remove stale: Get-AppxPackage <name> | Remove-AppxPackage |
| Signature invalid after time | Re-sign with --timestamp |
| File | Read when... |
|---|---|
references/sourcegen-patterns.md | Setting up AOT/trimming, JSON source generators, NativeAOT readiness, CsWin32 |
winapp package <build-output-dir> --cert ./devcert.pfx# Local install
Add-AppxPackage ./MyApp.msix
# Or double-click the .msix file