agentleFS
MicrosoftKnown publishermicrosoft/winappCli/plugins/winui/agent-plugin/skills/winui-packaging/SKILL.md

winui-packaging

Skill1.4k starsChanged 55 days agoMITView on GitHub

MSIX packaging, signing, and Microsoft Store publishing for WinUI 3 apps with WinApp CLI 0.7+: project packaging, Native AOT, certificates, self-contained deployment, CI/CD. Use when releasing or publishing a WinUI app. Not for WPF, WinForms, or Electron apps that only reference the Windows App SDK.

1 other project uses a version of this, 1 of them edited.

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Most recently taken up by

Who's talking about microsoft/winappCli

The biggest 5 of 52 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 52

Talked about on GitHub, Bluesky and Stack Overflow (52 times).

On GitHub · 50

45 more on GitHub

On Bluesky · 1

On Stack Overflow · 1

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check manifest identity, target architectures, the SDK for the app's TFM, and release warnings.

    line 26
  2. Very specific:

    Do not run/register/unregister a development package just to produce release artifacts.

    line 30
  3. Very specific:

    When installation/testing is part of the task, choose the target per winui-ui-testing Step 1, and get consent for certificate trust and …

    line 60

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Scope: WinUI 3 apps only. The Windows App SDK is not WinUI. A WPF, WinForms, Electron, or other app that references the Windows App SDK (for notifications, packaging, or other APIs) is not a WinUI app; keep its framework and don't apply this skill unless the task is to port it to WinUI 3. A WinUI 3 project has <UseWinUI>true</UseWinUI> or uses Microsoft.UI.Xaml.

Requires WinApp CLI 0.7+. For analyzer setup, see winui-dev-workflow.

Quick Reference

TaskCommand
Release package + signwinapp package .\MyApp.csproj --arch x64 --cert .\devcert.pfx
Unsigned multi-architecture bundlewinapp package .\MyApp.csproj --arch x64 --arch arm64 --no-sign
Generate dev certificatewinapp cert generate
Trust certificate (admin)winapp cert install ./devcert.pfx
Sign existing filewinapp sign ./app.msix ./devcert.pfx
Bundle Windows App SDK runtimewinapp package .\MyApp.csproj --arch x64 --cert .\devcert.pfx --self-contained

End-to-End Workflow

Step 1: Check the Project and Deployment Intent

  • Pass the explicit project file, not . or a guessed bin folder. WinUI project packaging uses SDK-native dotnet publish packaging, defaults to Release, and preserves project AOT settings.
  • Check manifest identity, target architectures, the SDK for the app's TFM, and release warnings.
  • For Native AOT, set <PublishAot>true</PublishAot> in the project and fix IL/CsWinRT warnings; there is no winapp package --aot. AOT also needs the MSVC C++ build tools. See source-generator patterns.
  • Project packaging rejects WindowsPackageType=None; restore the packaged setting first (see winui-dev-workflow Critical Rules).

Do not run/register/unregister a development package just to produce release artifacts. Project packaging builds without a development winapp run --no-launch step. For WinUI SDK-native packaging, do not pass layout overrides --manifest, --executable, or --skip-pri; fix the project/manifest instead.

Step 2: Generate Certificate (one-time)

winapp cert generate --manifest .\Package.appxmanifest

Creates a development devcert.pfx (default password: password). This certificate command's --manifest flag auto-matches the Publisher field in Package.appxmanifest. Keep PFX files/passwords out of source control; production signing needs the organization's signing policy.

Step 3: Trust on the Intended Test Machine (optional, admin)

winapp cert install ./devcert.pfx

Adds the cert to the machine trust store and persists across reboots. Do this only with approval on the intended test machine; it is not required just to build/package in CI.

Step 4: Package and Sign

winapp package .\MyApp.csproj --arch x64 --cert .\devcert.pfx
# Repeat --arch for a bundle
winapp package .\MyApp.csproj --arch x64 --arch arm64 --no-sign

Choose one signing policy: --cert takes a PFX file, not a certificate thumbprint; its subject must match the manifest's Identity.Publisher. --no-sign leaves an artifact for external signing. Use the artifact paths reported by the command, not a guessed output directory.

For timestamped production signing, create an unsigned package then sign the resulting artifact:

# Replace MyApp.msix with the package/bundle path returned above
winapp sign .\MyApp.msix .\prod.pfx --timestamp http://timestamp.digicert.com

--timestamp belongs to winapp sign, not winapp package. Use an approved timestamp service and protect the PFX/password.

Step 5: Install or Distribute

When installation/testing is part of the task, choose the target per winui-ui-testing Step 1, and get consent for certificate trust and dependency provisioning on that machine. Packaging alone is not permission to install an app.

Self-Contained Does Not Mean Single-File

winapp package --self-contained sets only WindowsAppSDKSelfContained=true, not .NET SelfContained=true. For a fully self-contained JIT .NET app, set both in the project:

<PropertyGroup>
  <SelfContained>true</SelfContained>
  <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
</PropertyGroup>

Native AOT covers the .NET runtime but still needs the Windows App SDK choice. Native WinUI runtime files stay alongside the executable/in the package; do not promise a single-file WinUI EXE. Some APIs still require additional MSIX dependencies; see the deployment guidance.

CI/CD

On a Windows runner provisioned with CLI 0.7+, the app's .NET SDK, and (for AOT) the native C++ toolchain, the packaging step can be:

winapp package .\MyApp.csproj --arch x64 --arch arm64 --no-sign
  • Committed package references, including the analyzer, restore normally; no machine-local analyzer is needed.
  • Archive the reported .msix/.msixbundle outputs using the CI system's artifact step. No UI launch or development registration is needed.
  • Retrieve production signing material through approved secret storage and sign in a separate protected step. Never commit a PFX or install a development root certificate just to build.

Store Submission

Associate the app with its Partner Center identity and follow its current submission requirements (package validation, ratings, screenshots, privacy policy). Use the SDK/Visual Studio packaging workflow when Store-upload artifacts or resource-package splitting are required. winapp package produces package artifacts; it does not publish to the Store or replace that submission workflow.

Troubleshooting

ErrorSolution
"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
Manifest missing / layout override rejectedCheck the explicit project and its original manifest; do not use winapp init or layout overrides to bypass SDK packaging
"Package installation failed"Check signing/trust and the exact conflicting identity; remove a stale registration only if confirmed and authorized
Signature invalid after timeSign with an approved timestamp service via winapp sign --timestamp

References

FileRead when...
references/sourcegen-patterns.mdSetting up AOT/trimming, JSON source generators, Native AOT readiness, CsWin32

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.