Labsco
microsoft logo

winapp-troubleshoot

โœ“ Officialโ˜… 1,128

by microsoft ยท part of microsoft/winappcli

Diagnose and fix common Windows app packaging, signing, identity, and SDK errors. Use when encountering errors with MSIX packaging, certificate signing, Windows SDK setup, or app installation.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup
๐Ÿงฐ Not standalone. This skill ships with microsoft/winappcli and only works together with that tool โ€” install the tool first, then add this skill.

This is the playbook your agent receives when the skill activates โ€” you don't need to read it to use the skill, but it's here to audit before installing.

When to use

Use this skill when:

  • Diagnosing errors from winapp CLI commands
  • Choosing the right command for a task
  • Understanding prerequisites โ€” what each command needs and what it produces

Command selection guide

Is the app a single .cs file (.NET file-based app)?
โ”œโ”€ Yes โ†’ winapp run <file>.cs  (builds it and generates the manifest for you)
โ””โ”€ No โ†’ Does the project have a Package.appxmanifest?
   โ”œโ”€ No โ†’ Do you want full setup (manifest + config + optional SDKs)?
   โ”‚       โ”œโ”€ Yes โ†’ winapp init (adds Windows platform files to existing project)
   โ”‚       โ””โ”€ No, just a manifest โ†’ winapp manifest generate
   โ””โ”€ Yes
      โ”œโ”€ Has winapp.yaml, cloned/pulled but .winapp/ folder missing?
      โ”‚  โ””โ”€ winapp restore
      โ”œโ”€ Want newer SDK versions?
      โ”‚  โ””โ”€ winapp update
      โ”œโ”€ Need a dev certificate?
      โ”‚  โ””โ”€ winapp cert generate (then winapp cert install for trust)
      โ”œโ”€ Need package identity for debugging? (see [Debugging Guide](https://github.com/microsoft/WinAppCli/blob/main/docs/debugging.md))
      โ”‚  โ”œโ”€ Exe is in your build output folder? (most frameworks)
      โ”‚  โ”‚  โ””โ”€ winapp run <build-output-dir>
      โ”‚  โ””โ”€ Exe is separate from app code? (Electron, sparse testing)
      โ”‚     โ””โ”€ winapp create-debug-identity <exe>
      โ”œโ”€ Ready to create MSIX installer?
      โ”‚  โ””โ”€ winapp package <build-output> --cert ./devcert.pfx
      โ”œโ”€ Need to sign an existing file?
      โ”‚  โ””โ”€ winapp sign <file> <cert>
      โ”œโ”€ Need to update app icons?
      โ”‚  โ””โ”€ winapp manifest update-assets ./logo.png
      โ”œโ”€ Need to run SDK tools directly?
      โ”‚  โ””โ”€ winapp tool <toolname> <args>
      โ”œโ”€ Need to publish to Microsoft Store?
      โ”‚  โ””โ”€ winapp store <args> (passthrough to Store Developer CLI)
      โ””โ”€ Need the .winapp directory path for build scripts?
         โ””โ”€ winapp get-winapp-path (or --global for shared cache)

Important notes:

  • winapp init adds files to an existing project โ€” it does not create a new project
  • The key prerequisite for most commands is Package.appxmanifest, not winapp.yaml
  • winapp.yaml is only needed for SDK version management (restore/update)
  • Projects with NuGet package references (e.g., .csproj referencing Microsoft.Windows.SDK.BuildTools) can use winapp commands without winapp.yaml
  • For Electron projects, use the npm package (npm install --save-dev @microsoft/winappcli) which includes Node.js-specific commands under npx winapp node

Debugging approach quick reference

GoalCommandKey detail
Run with identity (most common)winapp run .\build\DebugRegisters loose layout + launches; a console app gets an execution alias automatically
Attach debugger to running appwinapp run .\build\Debug โ†’ attach to PIDMisses startup code
Register identity, launch manuallywinapp run .\build\Debug --no-launchLaunch via start shell:AppsFolder\<AUMID> or execution alias โ€” not the exe directly
F5 startup debugging (IDE launches exe)winapp create-debug-identity .\bin\myapp.exeExe has identity regardless of how it's launched; best for debugging activation/startup code
Capture OutputDebugString + crash dumpwinapp run .\build\Debug --debug-outputOn crash, writes minidump and shows exception type, message, and faulting methods. Blocks other debuggers โ€” use --no-launch if you need VS Code/WinDbg
Run and auto-cleanwinapp run .\build\Debug --unregister-on-exitUnregisters the dev package after the app exits
Launch and detach (CI)winapp run .\build\Debug --detachReturns immediately after launch; use --json to get PID for scripting
Clean up stale registrationwinapp unregisterRemoves dev-mode packages for the current project (pass a .cs for a file-based app: winapp unregister counter.cs)
Start menu entry does nothing when clickedwinapp unregister --pruneThe package is registered but its files were deleted, so activation silently fails. Prune removes every dev registration whose files are gone

Visual Studio users: If you have a packaging project, VS already handles identity and debugging from F5 โ€” you likely don't need winapp for debugging. These workflows are for VS Code, terminal, and frameworks VS doesn't natively package.

For full details, see the Debugging Guide.

Debugging tips

  • Add --verbose (or -v) to any command for detailed output
  • Add --quiet (or -q) to suppress progress messages (useful in CI/CD)
  • Run winapp --cli-schema to get the full JSON schema of all commands and options
  • Run any command with --help for its specific usage information
  • Use winapp get-winapp-path to find where packages are stored locally
  • Use winapp get-winapp-path --global to find the shared cache location

Getting more help

  • Setup & init: winapp-setup โ€” adding Windows support to a project
  • Manifest: winapp-manifest โ€” creating and editing Package.appxmanifest
  • Signing: winapp-signing โ€” certificate generation and management
  • Packaging: winapp-package โ€” creating MSIX installers
  • Identity: winapp-identity โ€” enabling package identity for Windows APIs
  • Frameworks: winapp-frameworks โ€” framework-specific guidance (Electron, .NET, C++, Rust, Flutter, Tauri)
  • MAUI: winapp-maui โ€” packaging/signing .NET MAUI Windows apps and resolving the resizetizer manifest

CLI reference

Run winapp <command> --help for current command options, or winapp --cli-schema for the complete machine-readable command schema.