Microsoft.WindowsAppSDK.WinUI.CSharp.Templates
0.0.3-alpha
Prefix Reserved
dotnet new install Microsoft.WindowsAppSDK.WinUI.CSharp.Templates::0.0.3-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, class libraries, unit test projects, and common WinUI UI items — right
from the command line.
Installation
dotnet new install Microsoft.WindowsAppSDK.WinUI.CSharp.Templates
Available Templates
Project Templates
| Short Name | Description |
|---|---|
winui |
WinUI 3 blank app with single-project MSIX packaging |
winui-navview |
WinUI 3 NavigationView starter app |
winui-lib |
WinUI 3 class library for sharing UI components |
winui-unittest |
WinUI 3 packaged test app configured for MSTest |
Item Templates
| Short Name | Description |
|---|---|
winui-page |
Blank WinUI 3 Page |
winui-window |
Blank WinUI 3 Window |
winui-usercontrol |
WinUI 3 UserControl |
winui-templatedcontrol |
WinUI 3 templated control |
winui-resourcedictionary |
WinUI 3 ResourceDictionary |
winui-resw |
RESW resource file |
winui-dialog |
WinUI 3 ContentDialog |
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
Create a new WinUI 3 app
dotnet new winui -n MyApp
cd MyApp
dotnet build -p:Platform=x64
dotnet run -c Debug -p:Platform=x64
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
Choosing a Target Framework
By default, templates automatically detect your installed .NET SDK version and
set the target framework accordingly. For example, if you have .NET 10 SDK
installed, the TFM will be net10.0-windows10.0.26100.0.
To target a specific .NET version instead, pass --dotnet-version:
dotnet new winui --dotnet-version net8.0 -n MyApp
You can also edit the generated .csproj afterward and change
<TargetFramework> (and any related <RuntimeIdentifiers> entries) to your
preferred TFM.
Prerequisites
- .NET 10 SDK or later
- Windows 10 version 1809 (build 17763) or later
- Windows App SDK workload
Resources
Contributing
This template pack is built from the
WindowsAppSDK repository under
dev/VSIX/DotnetNewTemplates/. The templates share the same XAML, code-behind,
and project files as the Visual Studio templates under
dev/VSIX/ProjectTemplates/ and dev/VSIX/ItemTemplates/, so there is only one
copy to maintain.
Local Testing
- Pack the templates:
dotnet pack dev/VSIX/DotnetNewTemplates/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
Validation Checklist
- Run
dotnet packlocally anddotnet new installto verify each template scaffolds and builds. - Run
dotnet new list | findstr winuito confirm all templates are registered. - Build generated projects for x64, x86, and ARM64 in Visual Studio or VS Code.
- 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.3-alpha | 38 | 3/19/2026 |
See https://github.com/microsoft/WindowsAppSDK/releases for release notes.