winui-packaging

द्वारा microsoft

MSIX पैकेजिंग, कोड साइनिंग, और WinUI 3 ऐप्स के लिए वितरण — रिलीज़ के लिए बिल्ड, प्रमाणपत्र जनरेशन (winapp cert generate), प्रमाणपत्र ट्रस्ट, कोड…

npx skills add https://github.com/microsoft/win-dev-skills --skill winui-packaging

Quick Reference

TaskCommand
Build for release.\BuildAndRun.ps1 /p:Configuration=Release
Package + signwinapp package <dir> --cert devcert.pfx
Generate + sign + packagewinapp package <dir> --generate-cert --install-cert
Generate dev certificatewinapp cert generate
Trust certificate (admin)winapp cert install ./devcert.pfx
Sign existing filewinapp sign ./app.msix ./devcert.pfx
Self-contained deploymentwinapp 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 -SkipRun

Step 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.pfx

Adds cert to machine Trusted Root store. Persists across reboots.

Step 4: Package and Sign

winapp package <build-output-dir> --cert ./devcert.pfx

This 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 file

Key Rules

  • Publisher must match between certificate and manifest Identity.Publisher — use winapp cert generate --manifest to 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 --quiet for clean output
  • Use --if-exists skip with cert generate to 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

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
"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 timeRe-sign with --timestamp

References

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

microsoft की और Skills

oss-growth
microsoft
OSS ग्रोथ हैकर व्यक्तित्व
official
accessibility-aria-expert
microsoft
React/Fluent UI वेबव्यू में पहुँच संबंधी समस्याओं का पता लगाता है और उन्हें ठीक करता है। स्क्रीन रीडर संगतता के लिए कोड की समीक्षा करते समय, ARIA लेबल ठीक करते समय, सुनिश्चित करते समय उपयोग करें…
official
generate-canvas-app
microsoft
[पुराना हो चुका है — इसके बजाय canvas-app का उपयोग करें] एक पूर्ण Power Apps कैनवास ऐप जनरेट करें।
official
django
microsoft
Django वेब डेवलपमेंट के लिए सर्वोत्तम अभ्यास जिसमें मॉडल, व्यू, टेम्पलेट और परीक्षण शामिल हैं।
official
github-issue-creator
microsoft
कच्चे नोट्स, एरर लॉग्स, वॉइस डिक्टेशन या स्क्रीनशॉट को साफ-सुथरे GitHub-फ्लेवर्ड मार्कडाउन इश्यू रिपोर्ट्स में बदलें। तब उपयोग करें जब उपयोगकर्ता बग जानकारी, एरर…
official
python-package-management
microsoft
निर्भरता प्रबंधन के लिए uv और कार्य स्वचालन के लिए poethepoet का उपयोग करता है।
official
runtime-validation
microsoft
माइग्रेटेड एप्लिकेशन के लिए रनटाइम सत्यापन — परीक्षण रणनीति (योजना चरण) और परीक्षण निष्पादन (सत्यापन चरण) को शामिल करता है: स्टार्टअप सत्यापन,…
official
azure-postgres-ts
microsoft
Azure Database for PostgreSQL Flexible Server से pg (node-postgres) पैकेज का उपयोग करके कनेक्ट करें, जिसमें पासवर्ड और Microsoft Entra ID (पासवर्डलेस) प्रमाणीकरण के लिए समर्थन है।
official