
Winui Packaging
- 107 installs
- 373 repo stars
- Updated August 3, 2026
- microsoft/win-dev-skills
winui-packaging is an agent skill for MSIX packaging, code signing, and Microsoft Store distribution of WinUI 3 apps via the winapp CLI.
About
The winui-packaging skill guides MSIX packaging, code signing, and distribution for WinUI 3 applications using the winapp CLI. The end-to-end workflow builds Release configuration via BuildAndRun.ps1, generates a devcert.pfx with winapp cert generate matched to Package.appxmanifest Publisher, trusts the certificate with winapp cert install, and packages plus signs in one step using winapp package. Key rules require Publisher identity alignment, admin elevation for cert install, production timestamp URLs to prevent signature expiry, and optional self-contained bundles that include the Windows App SDK runtime. CI/CD examples use microsoft/setup-WinAppCli with quiet flags and artifact upload. Store submission covers Partner Center registration, age ratings, screenshots, privacy policy, and browser-based MSIX upload. Troubleshooting maps publisher mismatch, untrusted certificates, missing appxmanifest, and stale package installs to concrete fixes. Use when preparing WinUI 3 release builds, creating MSIX installers, managing signing certificates, setting up packaging pipelines, or publishing to the Microsoft Store.
- End-to-end MSIX workflow from Release build through cert generate, trust, package, and sign.
- Documents winapp package one-step signing plus self-contained and timestamp options.
- Includes GitHub Actions CI template with setup-WinAppCli and artifact upload.
- Covers Microsoft Store submission requirements and Partner Center upload steps.
- Troubleshooting table for publisher mismatch, cert trust, and signature expiry errors.
Winui Packaging by the numbers
- 107 all-time installs (skills.sh)
- +12 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #79 of 153 .NET & C# skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
winui-packaging capabilities & compatibility
- Capabilities
- release build and msix packaging workflow · certificate generation trust and signing command · self contained and timestamp signing options · github actions ci packaging template · store submission and troubleshooting guidance
- Works with
- github
- Use cases
- ci cd
What winui-packaging says it does
MSIX packaging, code signing, and distribution for WinUI 3 apps
npx skills add https://github.com/microsoft/win-dev-skills --skill winui-packagingAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 107 |
|---|---|
| repo stars | ★ 373 |
| Last updated | August 3, 2026 |
| Repository | microsoft/win-dev-skills ↗ |
How do I build, sign, and package a WinUI 3 app as MSIX for local install or Microsoft Store release?
Package, sign, and distribute WinUI 3 apps as MSIX with winapp CLI, GitHub Actions CI, and Microsoft Store submission.
Who is it for?
Windows developers releasing WinUI 3 apps who need MSIX packaging, signing, CI/CD, or Store upload guidance.
Skip if: Skip for WinUI project scaffolding, XAML debugging, or non-Windows deployment targets.
When should I use this skill?
User asks to package WinUI app, create MSIX installer, sign with winapp, or submit to Microsoft Store.
What you get
A signed MSIX package with trusted certificates, optional CI pipeline, and store submission checklist.
Files
Quick Reference
| Task | Command |
|---|---|
| Build for release | .\BuildAndRun.ps1 /p:Configuration=Release |
| 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 |
End-to-End Workflow
Step 1: Build for Release
Use the BuildAndRun.ps1 script from the winui-dev-workflow skill to build your app in Release configuration without launching it:
.\BuildAndRun.ps1 /p:Configuration=Release -SkipRunStep 2: Generate Certificate (one-time)
winapp cert generate --manifest .Creates devcert.pfx (default password: password). The --manifest flag auto-matches the Publisher field in Package.appxmanifest.
Step 3: Trust Certificate (one-time, requires admin)
winapp cert install ./devcert.pfxAdds cert to machine Trusted Root store. Persists across reboots.
Step 4: Package and Sign
winapp package <build-output-dir> --cert ./devcert.pfxThis locates appxmanifest.xml, stages the layout, generates resources.pri, creates .msix, and signs it.
Step 5: Install or Distribute
# Local install
Add-AppxPackage ./MyApp.msix
# Or double-click the .msix fileKey Rules
- Publisher must match between certificate and manifest
Identity.Publisher— usewinapp cert generate --manifestto auto-match - Prefer `winapp package --cert` over separate
winapp sign— one step instead of two - `cert install` requires admin — run terminal as Administrator
- Default PFX password is
password— override with--password - `--timestamp` is critical for production — without it, signatures expire with the cert:
winapp package <dir> --cert prod.pfx --timestamp http://timestamp.digicert.com- `--self-contained` bundles Windows App SDK runtime — larger but no runtime dependency
CI/CD with GitHub Actions
name: Build and Package
on: [push]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-WinAppCli@v0.1
- name: Build
run: dotnet build -c Release -p:Platform=x64
- name: Package
run: |
winapp cert generate --if-exists skip --quiet
winapp package ./bin/x64/Release/ --cert ./devcert.pfx --quiet
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: msix-package
path: "*.msix"CI/CD tips:
- Use
--quietfor clean output - Use
--if-exists skipwithcert generateto avoid failures on re-runs - Store production PFX as a repository secret
Store Submission
1. Partner Center account — register at partner.microsoft.com 2. Age ratings — complete the questionnaire in Partner Center 3. Screenshots — capture at 1366x768 minimum resolution 4. Privacy policy — required for apps that access internet or user data 5. Submit: upload the signed .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.
Troubleshooting
| 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> \ |
| Signature invalid after time | Re-sign with --timestamp |
References
| File | Read when... |
|---|---|
references/sourcegen-patterns.md | Setting up AOT/trimming, JSON source generators, NativeAOT readiness, CsWin32 |
Source Generator Patterns — Detailed Reference
Detailed code patterns for AOT compilation and source generators. See SKILL.md for rules summary.
---
Trimming Configuration
<PropertyGroup>
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>full</TrimMode>
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
</PropertyGroup>For reflection-heavy code, annotate to preserve members:
public void LoadService([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] Type serviceType)
=> Activator.CreateInstance(serviceType);---
Trim Compatibility Testing
Keep warnings enabled during development:
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
<TrimmerSingleWarn>false</TrimmerSingleWarn>Patterns to eliminate:
Type.GetType("MyNamespace.MyClass")— usetypeof(T)or[DynamicDependency]Activator.CreateInstance(someType)without[DynamicallyAccessedMembers]Assembly.LoadFrom()— use compile-time references- Unattributed reflection:
typeof(T).GetProperties()
---
JSON Source Generator Setup
[JsonSerializable(typeof(UserProfile))]
[JsonSerializable(typeof(List<UserProfile>))]
internal partial class AppJsonContext : JsonSerializerContext { }
// No reflection at runtime
var json = JsonSerializer.Serialize(profile, AppJsonContext.Default.UserProfile);
var obj = JsonSerializer.Deserialize(json, AppJsonContext.Default.UserProfile);---
Regex Source Generator
public partial class InputValidator
{
[GeneratedRegex(@"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$")]
private static partial Regex EmailRegex();
public bool IsValidEmail(string input) => EmailRegex().IsMatch(input);
}---
XAML Compilation (x:Bind)
<!-- ✅ AOT-safe: compile-time generated -->
<TextBlock Text="{x:Bind ViewModel.Title, Mode=OneWay}" />
<!-- ❌ Reflection-based, not trim-safe -->
<TextBlock Text="{Binding Path=Title}" />Set x:DataType on pages: <Page x:DataType="viewmodels:MainViewModel">
---
CsWin32 Setup
Generates P/Invoke wrappers at compile time. Add Microsoft.Windows.CsWin32 NuGet package. List needed APIs in NativeMethods.txt:
GetDpiForWindow
SetWindowPos
ShowWindow---
CommunityToolkit.Mvvm Source Generators
Use partial properties (CommunityToolkit.Mvvm 8.4+). The legacy field form emits MVVMTK0045 in WinRT/WinUI projects.
public partial class SettingsViewModel : ObservableObject
{
[ObservableProperty] public partial string UserName { get; set; }
[RelayCommand] private async Task SaveAsync() => await _service.SaveAsync(UserName);
}---
Single-File Publishing Configuration
<PropertyGroup>
<SelfContained>true</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
</PropertyGroup>Primarily for unpackaged apps. Combine with <PublishTrimmed>true</PublishTrimmed>.
Related skills
FAQ
What does winui-packaging produce?
A signed MSIX package from a Release build with certificate generation, trust steps, and optional CI/CD or Store submission guidance.
When should I use winui-packaging?
When preparing a WinUI 3 app for release with MSIX packaging, code signing, or Microsoft Store distribution.
Is winui-packaging safe to install?
Review the Security Audits panel on this page before installing in production.