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

Winui Setup

  • 107 installs
  • 373 repo stars
  • Updated August 3, 2026
  • microsoft/win-dev-skills

winui-setup is an agent skill that installs and verifies .NET SDK, WinApp CLI, WinUI 3 templates, and Developer Mode for WinUI development.

About

The winui-setup skill installs and verifies prerequisites every other winui skill assumes on a Windows machine. It is idempotent: each step checks first, skips when satisfied, and prints status before installing anything. Detection batches checks for .NET SDK 8 or newer, WinApp CLI version 0.3 plus, WinUI 3 dotnet templates, and Developer Mode registry state, then shows a one-shot status table. Installation uses winget for Microsoft.DotNet.SDK.10 when no SDK 8 plus exists, always upgrades WinApp CLI to latest, refreshes PATH after winget installs, and reinstalls Microsoft.WindowsAppSDK.WinUI.CSharp.Templates for current templates. Developer Mode requires explicit user consent before UAC elevation because admin is needed only for that registry change. The skill forbids installing Visual Studio, GitHub Copilot CLI, or elevating the entire session. A final summary table reports what changed and suggests next steps with winui-dev-workflow. Use on new machines, after Windows reset, or when winapp or dotnet commands are missing.

  • Idempotent prerequisite detection for .NET SDK, WinApp CLI, templates, and Developer Mode.
  • Batch status table before installing so users see the full plan upfront.
  • Always upgrades WinApp CLI and WinUI templates even when already present.
  • Requires user consent before UAC elevation for Developer Mode only.
  • Explicit do-not rules against Visual Studio install and full-session elevation.

Winui Setup 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)
At a glance

winui-setup capabilities & compatibility

Capabilities
parallel prerequisite detection and status repor · winget based sdk and winapp cli installation · path refresh after winget package installs · user consented developer mode uac elevation · final summary table with next step guidance
Use cases
devops
From the docs

What winui-setup says it does

Do not install Visual Studio.
SKILL.md
npx skills add https://github.com/microsoft/win-dev-skills --skill winui-setup

Add your badge

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

Listed on Skillselion
Installs107
repo stars373
Last updatedAugust 3, 2026
Repositorymicrosoft/win-dev-skills

How do I set up a Windows machine with all WinUI 3 prerequisites when winapp or templates are missing?

Install and verify .NET SDK, WinApp CLI, WinUI 3 templates, and Developer Mode prerequisites for WinUI development.

Who is it for?

Developers onboarding to WinUI 3 who need automated prerequisite detection and winget-based installation.

Skip if: Skip when prerequisites are already verified or when the task is packaging, building apps, or Visual Studio workload setup.

When should I use this skill?

User sets up new WinUI machine, winapp not found, dotnet missing, or WinUI templates absent.

What you get

A verified toolchain with .NET SDK, latest WinApp CLI, WinUI templates, and optional Developer Mode enabled.

Files

SKILL.mdMarkdownGitHub ↗

Purpose

Install and verify the prerequisites every other winui-* skill assumes are already present on the machine.

This skill is idempotent — every step checks first, skips if already satisfied, prints [OK] already installed and moves on. Re-running on a fully set-up machine is a fast no-op.

Steps

The first thing to do is batch all detection up front — run every check in parallel/together so you can show the user the full picture before installing anything. Then install only what's missing.

Detect everything

Run all of these together; collect the results:

# .NET SDK — accept any installed SDK >= 8.0
$dotnetSdks = (& dotnet --list-sdks 2>$null) -replace ' \[.*$',''
$dotnetOk   = $dotnetSdks | ForEach-Object { [version]($_ -split '-')[0] } |
              Where-Object { $_.Major -ge 8 } | Select-Object -First 1

# WinApp CLI — needs to be present AND >= 0.3
$winappVersion = $null
$winappOk      = $false
$winappCmd     = Get-Command winapp -ErrorAction SilentlyContinue
if ($winappCmd) {
    $raw = (& winapp --version 2>$null) -as [string]
    if ($raw) {
        $base = ($raw -split '-')[0]   # strip "-prerelease.N" if present
        try {
            $winappVersion = [version]$base
            $winappOk      = $winappVersion -ge [version]'0.3'
        } catch {}
    }
}

# WinUI 3 templates
$templatesOk = [bool](dotnet new list winui 2>$null | Select-String 'winui-mvvm' -Quiet)

# Developer Mode
$devModeOk = ((Get-ItemProperty `
  -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock' `
  -Name AllowDevelopmentWithoutDevLicense -ErrorAction SilentlyContinue
).AllowDevelopmentWithoutDevLicense) -eq 1

Print a one-shot status table so the user sees what you're about to do:

.NET SDK ≥ 8           ✅ found 10.0.100   (or ❌ missing — will install Microsoft.DotNet.SDK.10)
WinApp CLI             ⚠ found 0.3.1 — will upgrade to latest
                       (or ❌ missing/too old — will install Microsoft.WinAppCLI)
WinUI 3 templates      ✅ found — will reinstall to make sure they're at latest
Developer Mode         ❌ disabled — needs admin to enable
Always upgrade WinApp CLI and the WinUI templates even when they're already present — they ship breaking changes between releases and the rest of the winui-* skills assume latest. The minimum bar is "WinApp CLI ≥ 0.3 and templates installed at all"; the goal is "both at latest".
Install what's missing

Skip anything already-OK from detection. The remaining steps:

.NET SDK (only if no SDK ≥ 8.0 was found)
winget install --id Microsoft.DotNet.SDK.10 --exact --silent --accept-package-agreements --accept-source-agreements

.NET 8.0 is the floor. If the user already has 8.0, 9.0, or 10.0 installed (any patch), the requirement is met — do not install another SDK side-by-side.

WinApp CLI — install if missing/old, then always upgrade

If $winappOk is false (missing or < 0.3), install it. Then always run winget upgrade regardless, so even already-present installs get bumped to latest:

# Install only if missing or too old
winget install --id Microsoft.WinAppCLI --exact --silent --accept-package-agreements --accept-source-agreements

# Always — upgrade to latest (no-op if already at latest)
winget upgrade --id Microsoft.WinAppCLI --exact --silent --accept-package-agreements --accept-source-agreements
Refresh $env:Path

If you installed the .NET SDK or anything else via winget in this session, refresh PATH so subsequent steps can find the new tools. Without this, dotnet new install will fail with "command not found" even though the SDK is on disk:

$env:Path = [Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [Environment]::GetEnvironmentVariable('Path','User')
WinUI 3 .NET templates — always reinstall to get latest

Run this every time, whether or not $templatesOk was true. dotnet new install against an already-installed template package upgrades it in place to the latest version:

dotnet new install Microsoft.WindowsAppSDK.WinUI.CSharp.Templates
Developer Mode (ask the user first!)

Developer Mode is the DWORD AllowDevelopmentWithoutDevLicense under HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock. Setting it requires admin, which means a UAC prompt will pop up. Do not just trigger UAC out of nowhere — ask the user first so they're not surprised by the elevation prompt. Use language like:

Developer Mode is currently disabled. Enabling it requires a one-time admin elevation (a UAC prompt will appear). Would you like me to enable it now? (yes / no / I'll do it later)

Only if the user agrees, re-elevate only this step via UAC:

Start-Process powershell -Verb RunAs -ArgumentList @(
  '-NoProfile','-Command',
  "New-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock' -Force | Out-Null; " +
  "Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock' " +
  "-Name AllowDevelopmentWithoutDevLicense -Type DWord -Value 1"
) -Wait

If the user declines (either says no, or accepts but then dismisses the UAC prompt), do not abort the whole skill. Print the literal command above so they can run it later from an elevated PowerShell, and continue to the summary.

Final summary — always print this

After everything, print a single-table summary so the user knows exactly what changed:

==== winui-setup summary ====
.NET SDK ≥ 8               ⏭ already present (9.0.313)
WinApp CLI                 ✅ upgraded to 0.4.0  (or ✅ installed, ⏭ already at latest, ❌ failed)
WinUI 3 templates          ✅ updated to latest
Developer Mode             ✅ enabled  (or ⏭ skipped — user declined, or ❌ failed: <reason>)

You're ready. Try:
  copilot --agent winui:winui-dev -p "build me a WinUI 3 markdown editor"

Things to NOT do

  • Do not install Visual Studio. It's optional and multi-GB. If the user wants the full Visual Studio + WinUI workload (recommended for the XAML-diagnostic workaround that winui-dev-workflow calls out), tell them at the end of the summary they can install it themselves with:
  winget install Microsoft.VisualStudio.Community --override "--add Microsoft.VisualStudio.Workload.Universal"
  • Do not install GitHub Copilot CLI. If this skill is running, it's already installed.
  • Do not elevate the entire session — only step 5 needs admin. Elevating earlier steps would install winget packages into the admin user's profile instead of the user's, which is wrong.
  • Do not skip the PATH refresh — agents that skip it install the SDK and then immediately fail on dotnet new install.
  • Do not trigger UAC for Developer Mode without asking the user first — the prompt is jarring if it pops up unannounced. Always confirm before elevating.
  • Do not silently retry on failure. If a winget install fails (no network, package source down, permissions), record the error in the summary table and move on. Let the user see what failed.
  • Do not install .NET 10 if the machine already has any .NET SDK ≥ 8.0 — the floor is 8.0, and adding another SDK side-by-side wastes disk space.

Related skills

FAQ

What does winui-setup install?

.NET SDK 8 plus if missing, latest WinApp CLI, WinUI 3 templates, and optionally Developer Mode with user approval.

When should I use winui-setup?

On a new Windows machine, after reset, or when another winui skill reports missing prerequisites.

Is winui-setup 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.