Microsoft.WindowsAppSDK.WinUI.CSharp.Templates
0.0.7-alpha
Prefix Reserved
dotnet new install Microsoft.WindowsAppSDK.WinUI.CSharp.Templates@0.0.7-alpha
Windows App SDK WinUI 3 C# Templates
Official WinUI 3 project and item templates for the
Windows App SDK,
designed for use with the .NET CLI (dotnet new). This template pack provides
the same starting points available in Visual Studio — blank apps, navigation
views, MVVM scaffolding, tab-view shells, class libraries, unit test projects,
and common WinUI UI items — right from the command line.
dotnet run launches the generated app with full MSIX package identity, so
features that require it (notifications, background tasks, Windows AI APIs,
etc.) work the same as they would in a Visual Studio F5 deploy.
Installation
dotnet new install Microsoft.WindowsAppSDK.WinUI.CSharp.Templates
Available Templates
Project Templates
Get below list via dotnet new list winui
| Short Name | Description |
|---|---|
winui |
Minimal WinUI 3 blank app with MSIX packaging. Start here if unsure |
winui-mvvm |
WinUI 3 MVVM app using CommunityToolkit.Mvvm |
winui-navview |
WinUI 3 NavigationView starter app with MSIX packaging |
winui-tabview |
WinUI 3 TabView starter app with MSIX packaging |
winui-lib |
WinUI 3 class library for sharing UI components |
winui-unittest |
WinUI 3 packaged test app configured for MSTest |
Each winui-* short name also has a winui3-* alias (e.g. winui3-mvvm).
Reactor Templates (Experimental)
These templates are experimental. Microsoft.UI.Reactor is prerelease software: its API may change in breaking ways between releases, and these templates may change or be removed. They aren't recommended for production apps yet.
Microsoft.UI.Reactor is a declarative, React-style way to build WinUI 3 apps in pure C# — no XAML. These templates scaffold a runnable, single-project MSIX-packaged Reactor app whose UI mirrors the matching WinUI 3 XAML templates.
Get the list via dotnet new list reactor
| Short Name | Description |
|---|---|
reactor |
Blank Reactor app (alias reactor-blank). Start here if unsure |
reactor-mvu |
Reactor app using the Model-View-Update pattern with UseReducer |
reactor-navview |
Reactor app with a NavigationView shell and multiple pages |
reactor-tabview |
Reactor app with a TabView shell whose tabs live in the title bar |
Each also has a winui-reactor* alias (e.g. winui-reactor, winui-reactor-mvu)
so they show up under dotnet new list winui alongside the other WinUI templates.
Reactor apps are packaged (single-project MSIX) and reference the
Microsoft.UI.Reactor
preview NuGet package. They require .NET 10 or later. Like the WinUI templates,
they reference Microsoft.Windows.SDK.BuildTools.WinApp so dotnet run launches
the app with full MSIX package identity. Pin a specific Reactor package version
at scaffold time with --reactor-version, or the Windows App SDK version with
--wasdk-version.
Item Templates
| Short Name | Description |
|---|---|
winui-page |
WinUI 3 Page (XAML + code-behind) |
winui-window |
WinUI 3 Window (XAML + code-behind) |
winui-usercontrol |
WinUI 3 UserControl (XAML + code-behind) |
winui-templatedcontrol |
WinUI 3 templated control |
winui-resourcedictionary |
WinUI 3 ResourceDictionary |
winui-resw |
RESW resources file for localized strings |
winui-dialog |
WinUI 3 ContentDialog (XAML + code-behind) |
Item templates are context-aware and only surface when dotnet new is executed
inside a WinUI project folder or when --project points to one.
Quick Start
Quickstart a new WinUI 3 APP
dotnet new winui -n MyApp
cd MyApp
# dotnet build
dotnet run
dotnet run registers a loose-layout MSIX, gives the app package identity,
and launches it via AUMID activation — equivalent to F5 in Visual Studio.
Quickstart a new Reactor app
dotnet new reactor -n MyReactorApp
cd MyReactorApp
dotnet run
Reactor apps are pure C# (no XAML) and packaged (single-project MSIX), so
dotnet run registers a loose-layout package and launches the app with full
MSIX package identity — equivalent to F5 in Visual Studio. See the
Reactor documentation to
learn the component model, hooks, and layout system. Swap reactor for
reactor-mvu, reactor-navview, or reactor-tabview to start from a richer
shell.
Add items to an existing project
dotnet new winui-page -n SettingsPage --project .\MyApp.csproj
dotnet new winui-usercontrol -n ProfileCard --project .\MyApp.csproj
dotnet new winui-window -n SecondaryWindow --project .\MyApp.csproj
dotnet new winui-dialog -n ConfirmDialog --project .\MyApp.csproj
Choosing a Target Framework
Generated projects target net{N}.0-windows10.0.26100.0, where {N} is
selected at scaffold time via --dotnet-version:
dotnet new winui --dotnet-version net8.0 -n MyApp
dotnet new winui --dotnet-version net9.0 -n MyApp
dotnet new winui --dotnet-version net10.0 -n MyApp
Supported choices: net8.0, net9.0, net10.0. If you omit
--dotnet-version, most templates default to net10.0; winui-mvvm matches
your installed .NET SDK. You can also edit <TargetFramework> in the
generated .csproj afterward.
Customizing dotnet run behavior
Set any of these MSBuild properties inside a <PropertyGroup> in the
generated .csproj to tweak how dotnet run launches the app:
| Property | Default | Effect |
|---|---|---|
EnableWinAppRunSupport |
true |
Set to false to disable the packaged-launch integration and run unpackaged instead |
WinAppRunUseExecutionAlias |
false |
For console apps — launches via uap5:ExecutionAlias so stdin/stdout stay in the terminal |
WinAppRunNoLaunch |
false |
Register the package but don't launch (useful when attaching a different debugger first) |
WinAppRunDebugOutput |
false |
Capture OutputDebugString and crash dumps; cannot be combined with another debugger |
WinAppLaunchArgs |
(empty) | Arguments passed to the app on launch (e.g. --my-flag value) |
These properties are provided by the
Microsoft.Windows.SDK.BuildTools.WinApp
NuGet package, which is referenced automatically by the project templates.
Prerequisites
- .NET SDK —
net8.0,net9.0, ornet10.0 - Windows 10 version 1809 (build 17763) or later
- Developer Mode enabled — required for
dotnet runto register the loose-layout package. Settings → System → For developers → Developer Mode → On.
Resources
Contributing
This template pack is built from the
WindowsAppSDK repository under
dev/Templates/Dotnet/. The templates share the same XAML, code-behind,
and project files as the Visual Studio templates under
dev/Templates/Source/ProjectTemplates/ and
dev/Templates/Source/ItemTemplates/, so there is only one copy to maintain.
Local Testing
- Pack the templates:
dotnet pack dev/Templates/Dotnet/WinAppSdk.CSharp.DotnetNewTemplates.csproj -c Release -o localpackages - Uninstall any previous version:
dotnet new uninstall Microsoft.WindowsAppSDK.WinUI.CSharp.Templates - Install the local package:
dotnet new install ./localpackages/Microsoft.WindowsAppSDK.WinUI.CSharp.Templates.<version>.nupkg
For an automated end-to-end run that scaffolds, builds, and (optionally) launches every template, use the included script:
.\dev\Templates\Dotnet\Test-DotnetNewTemplates.ps1 # full run
.\dev\Templates\Dotnet\Test-DotnetNewTemplates.ps1 -SkipAppLaunch # CI-friendly
Validation Checklist
- Run
dotnet packlocally anddotnet new installto verify the local build. - Run
dotnet new list winuito review and confirm all templates are registered. - Build generated projects for x64, x86, and ARM64 in Visual Studio or
dotnet build. - Test packaged deployments on Windows 10 version 1809 or later.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.7-alpha | 377 | 9/23/2026 |
| 0.0.6-alpha | 26,263 | 6/1/2026 |
| 0.0.5-alpha | 3,466 | 5/8/2026 |
| 0.0.4-alpha | 1,060 | 4/26/2026 |
| 0.0.3-alpha | 2,003 | 3/19/2026 |
See https://github.com/microsoft/WindowsAppSDK/releases for release notes.