Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
microsoft avatar

Winui Dev Workflow

  • 113 installs
  • 370 repo stars
  • Updated July 27, 2026
  • microsoft/win-dev-skills

winui-dev-workflow is an agent skill for building and running WinUI 3 apps with BuildAndRun.ps1, winapp run, and error diagnosis.

About

The winui-dev-workflow skill provides the build and run workflow for WinUI 3 apps including project creation, BuildAndRun.ps1 execution, winapp run launching, error diagnosis, and prerequisite verification. New apps scaffold with dotnet new winui-mvvm creating CommunityToolkit.Mvvm MVVM structure with TitleBar, MicaBackdrop, and Frame navigation without pre-creating directories. Package installs use dotnet add package without pinned versions to get latest stable APIs. BuildAndRun.ps1 checks Developer Mode, finds the csproj, auto-detects x64 or ARM64, builds with MSBuild, and launches via winapp run --debug-output. Agents must invoke the script asynchronously because sync mode blocks for the app lifetime, while -Detach and -SkipRun are safe for synchronous calls. Common errors map Developer Mode, missing types, XAML binding failures, OneTime x:Bind blank UI, silent XAML compiler crashes, and package install failures to specific fixes. Prerequisites require Windows 10 v1903+, Developer Mode, .NET SDK 8.0 minimum, winapp CLI, and WinUI templates, with missing tools routed to /winui-setup rather than agent self-install. Critical rules forbid running packaged exe directly, adding Windo.

  • Scaffolds MVVM WinUI apps via dotnet new winui-mvvm template.
  • BuildAndRun.ps1 handles Developer Mode check, build, and winapp run launch.
  • Requires async invocation because the script stays attached to running apps.
  • Maps common CS, XAML, and package errors to documented fixes.
  • Routes missing prerequisites to /winui-setup instead of agent self-install.

Winui Dev Workflow by the numbers

  • 113 all-time installs (skills.sh)
  • Ranked #73 of 154 .NET & C# skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 27, 2026 (Skillselion catalog sync)
At a glance

winui-dev-workflow capabilities & compatibility

Capabilities
winui mvvm project scaffolding · buildandrun.ps1 automated build and launch · common winui xaml and package error diagnosis · prerequisite verification and winui setup routin · winapp run launch with async agent invocation gu
Use cases
frontend · debugging
Platforms
Windows
From the docs

What winui-dev-workflow says it does

dotnet new winui-mvvm -n <AppName>
SKILL.md
npx skills add https://github.com/microsoft/win-dev-skills --skill winui-dev-workflow

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs113
repo stars370
Security audit3 / 3 scanners passed
Last updatedJuly 27, 2026
Repositorymicrosoft/win-dev-skills

How do I build and run a WinUI 3 app and fix common scaffold, XAML, and launch errors?

Build and run WinUI 3 apps with BuildAndRun.ps1, winapp run, scaffold templates, and common error diagnosis.

Who is it for?

Developers building or running WinUI 3 projects who need BuildAndRun.ps1 automation and error troubleshooting.

Skip if: Skip for non-WinUI platforms, code quality review before commit, or environments without Windows prerequisites.

When should I use this skill?

User builds, runs, or fixes build errors in a WinUI 3 project or scaffolds a new WinUI MVVM app.

What you get

A running WinUI app launched via winapp run with build errors diagnosed and prerequisites verified.

Files

SKILL.mdMarkdownGitHub ↗

Create or Open a Project

New app — scaffold with a template:

dotnet new winui-mvvm -n <AppName>
cd <AppName>

Creates an MVVM project with CommunityToolkit.Mvvm, TitleBar, MicaBackdrop, and Frame navigation. Do NOT mkdir first — -n creates the folder.

Existing app — read the .csproj to understand:

  • <TargetFramework> (e.g., net10.0-windows10.0.26100.0)
  • <PackageReference> versions (WindowsAppSDK, CommunityToolkit)
  • Project structure and established patterns

Install Packages

dotnet add package <Name>

Never specify --version — omitting it gets the latest stable and avoids outdated API mismatches.

Build & Run

Use the BuildAndRun.ps1 script (included with this skill) — it handles everything:

.\BuildAndRun.ps1

Invoke the script with `mode: "async"`. The script stays attached to the running app so a mode: "sync" call blocks your turn for the entire lifetime of the app. The output contains the PID of the running app once the app starts, which looks like this:

✅ <pkg> launched (PID: 12345)

What the script does automatically: 1. Checks Developer Mode is enabled (fails fast if not) 2. Finds the .csproj in the current directory 3. Auto-detects platform (x64 or ARM64) 4. Builds with MSBuild (or falls back to dotnet build) 5. Finds the build output folder 6. Launches with winapp run --debug-output

Options:

.\BuildAndRun.ps1                          # auto-find csproj, build, run (should use async invocation)
.\BuildAndRun.ps1 MyApp.csproj             # explicit project
.\BuildAndRun.ps1 -Detach                  # run in detached mode, no debug output or exceptions (safe to use mode: "sync")
.\BuildAndRun.ps1 -SkipRun                 # build only (safe to use mode: "sync")
.\BuildAndRun.ps1 /p:Configuration=Release # override defaults

If build fails: Read ALL errors, batch-fix them in one pass, then run BuildAndRun.ps1 again.

If the app crashes on launch: read_powershell the shell — first-chance exceptions appear in the output.

Common Errors

ErrorFix
Developer Mode not enabledSettings → System → For developers → On
CS0234/CS0246 missing typeAdd using or dotnet add package
NETSDK1136 platform requiredBuildAndRun.ps1 handles this automatically
XLS0414 XAML type not foundAdd xmlns declaration
XDG0062 binding path missingCheck x:Bind property exists on ViewModel
Blank window after launchx:Bind defaults to OneTime — add Mode=OneWay
App silently exitsUse winapp run, never run the .exe directly
XAML compiler crashes silentlyRemove any PresentationCore.dll / System.Windows references
0x80073CF6 package install failedRun winapp init, check manifest publisher matches cert
0x8007000B bad image formatWrong platform target — use x64 or ARM64, not AnyCPU

Prerequisites

RequirementMinimumRecommended (fresh installs)Install command
Windows 10 v1903+
Developer ModeenabledenabledSettings → Advanced → Developer Mode → On
.NET SDK8.010.0winget install Microsoft.DotNet.SDK.10
winapp CLI0.3latestwinget install Microsoft.WinAppCLI
WinUI templatesanylatestdotnet new install Microsoft.WindowsAppSDK.WinUI.CSharp.Templates

If any of these are missing when you try to access them — winapp or dotnet not recognized, the WinUI templates aren't installed, Developer Mode is off — do not try to install them yourself and do not try to work around it. Stop and tell the user the prerequisite is missing and ask them to run /winui-setup (a user-invoked skill that installs and verifies everything). Once they've finished, retry the failed command.

Critical Rules

  • ❌ NEVER run the packaged .exe directly — always use winapp run or BuildAndRun.ps1
  • ❌ NEVER add <WindowsPackageType>None to work around launch issues
  • ❌ NEVER delete Package.appxmanifest
  • ❌ NEVER use AnyCPU — always x64 or ARM64

References

  • BuildAndRun.ps1 — included with this skill, handles build + run automatically

Related skills

FAQ

What does winui-dev-workflow produce?

A built and running WinUI app via BuildAndRun.ps1 and winapp run with diagnosed fixes for common errors.

When should I use winui-dev-workflow?

When building, running, scaffolding, or fixing build and launch errors in a WinUI 3 project.

Is winui-dev-workflow safe to install?

Review the Security Audits panel on this page before installing in production.

.NET & C#frontend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.