Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
79d6804
Add missing item-content-dialog template for dotnet new
yeelam-gordon Feb 25, 2026
31f65f2
Add packaged template to NuGet template pack
yeelam-gordon Feb 25, 2026
b8c76b7
Update README with packaged and content-dialog templates
yeelam-gordon Feb 25, 2026
80c1b8f
Add language and type tags to all template.json files
yeelam-gordon Feb 25, 2026
63d5abf
Add postActions for automatic NuGet restore
yeelam-gordon Feb 25, 2026
ff0bc38
Add Windows-only OS constraint to all templates
yeelam-gordon Feb 25, 2026
9948ed6
Add description fields to template parameters
yeelam-gordon Feb 25, 2026
8405a8d
Add description fields to dotnetcli.host.json files
yeelam-gordon Feb 25, 2026
e510bf7
Add Copyright, license acceptance, and release notes to csproj
yeelam-gordon Feb 25, 2026
7c03a19
Update default dotnetVersion from net8.0 to net9.0
yeelam-gordon Feb 26, 2026
4891155
Use https:// for JSON schema URLs
yeelam-gordon Feb 26, 2026
37e473e
Revert packaged template from dotnet new pack
yeelam-gordon Feb 26, 2026
aa35f66
Use existing VS ContentDialog sources instead of hand-crafted copies
yeelam-gordon Feb 26, 2026
3f4b867
Align packaged template config with other templates
yeelam-gordon Feb 26, 2026
5f54158
Remove templates/packaged/ directory
yeelam-gordon Feb 26, 2026
5822173
Update default dotnetVersion from net9.0 to net10.0
yeelam-gordon Feb 26, 2026
ca54ea9
Rename template shortNames from wasdk-* to winui3-*
yeelam-gordon Feb 26, 2026
82793aa
Add winui3-page and winui3-usercontrol item templates
yeelam-gordon Feb 26, 2026
de87edc
Add project-capability and sdk-version constraints to item templates
yeelam-gordon Feb 26, 2026
2f8791a
Add sdk-version constraint to project templates
yeelam-gordon Feb 26, 2026
ac35acb
chore(project): update NoWarn property to include CS2008 warning
yeelam-gordon Feb 26, 2026
06e9d5c
feat(templates): update template identities to use WinUI naming conve…
yeelam-gordon Feb 26, 2026
938a820
feat(templates): add symbols section to various template configurations
yeelam-gordon Feb 26, 2026
87a6f8b
feat(templates): update dotnetVersion to support .NET 8, 9, and 10 ch…
yeelam-gordon Feb 26, 2026
ad16836
template renamings
MuyuanMS Feb 26, 2026
a5a381c
Merge branch 'user/yeelam/miscOnMuyuanBranch' of https://github.com/m…
MuyuanMS Feb 26, 2026
f56368c
Merge branch 'user/yeelam/miscOnMuyuanBranch' of https://github.com/m…
MuyuanMS Feb 26, 2026
df120b2
User/muyuanli/naming improvements (#6256)
MuyuanMS Feb 26, 2026
b834665
Merge branch 'user/yeelam/miscOnMuyuanBranch' into user/muyuanli/dotn…
MuyuanMS Feb 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions dev/VSIX/DotnetNewTemplates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,30 @@ code-behind, and project files.

## Templates

| Short name | Identity | Description |
|-----------------------|-------------------------------------------------|--------------------------------------------|
| `wasdk-single` | `Microsoft.WindowsAppSDK.CSharp.SingleProject` | Single-project MSIX WinUI 3 app |
| `wasdk-classlib` | `Microsoft.WindowsAppSDK.CSharp.ClassLibrary` | WinUI 3 class library |
| `wasdk-unittest` | `Microsoft.WindowsAppSDK.CSharp.UnitTest` | WinUI 3 packaged test app |
| `wasdk-item-blankwin` | `Microsoft.WindowsAppSDK.CSharp.Item.BlankWindow` | WinUI 3 Blank Window item template |
| Short name | Identity | Type | Description |
|-----------------------|-----------------------------------------------|----------|-----------------------------------------------------------|
| `winui` | `Microsoft.WindowsAppSDK.WinUI.CSharp.BlankApp` | Project | WinUI 3 blank app that uses single-project MSIX tooling |
| `winui-navview` | `Microsoft.WindowsAppSDK.WinUI.CSharp.NavigationApp` | Project | WinUI 3 NavigationView starter app |
| `winui-lib` | `Microsoft.WindowsAppSDK.WinUI.CSharp.ClassLibrary` | Project | WinUI 3 class library for sharing UI components |
| `winui-unittest` | `Microsoft.WindowsAppSDK.WinUI.CSharp.UnitTest` | Project | WinUI 3 packaged test app configured for MSTest |
| `winui-page` | `Microsoft.WindowsAppSDK.WinUI.CSharp.Item.Page` | Item | Adds a blank WinUI 3 Page |
| `winui-window` | `Microsoft.WindowsAppSDK.WinUI.CSharp.Item.Window` | Item | Adds a blank WinUI 3 Window |
| `winui-usercontrol` | `Microsoft.WindowsAppSDK.WinUI.CSharp.Item.UserControl.Legacy` | Item | Adds a WinUI 3 UserControl |
| `winui-templatedcontrol` | `Microsoft.WindowsAppSDK.WinUI.CSharp.Item.TemplatedControl` | Item | Adds a templated WinUI 3 control skeleton |
| `winui-resourcedictionary` | `Microsoft.WindowsAppSDK.WinUI.CSharp.Item.ResourceDictionary`| Item | Adds a WinUI 3 ResourceDictionary |
| `winui-resw` | `Microsoft.WindowsAppSDK.WinUI.CSharp.Item.Resw` | Item | Adds a RESW resource file |
| `winui-dialog` | `Microsoft.WindowsAppSDK.WinUI.CSharp.Item.ContentDialog` | Item | Adds a WinUI 3 ContentDialog |

Run `dotnet new <short name> -n MyProject` to create a project from the pack once it
is installed.
is installed. Item templates only surface when `dotnet new` is executed inside a
WinUI project folder (or when `--project` points to one) so that commands stay
context-aware.

## Local testing workflow

1. Pack the templates: `dotnet pack dev/VSIX/DotnetNewTemplates/WinAppSdk.CSharp.DotnetNewTemplates.csproj -c Release -o localpackages`.
2. If you already have an older version installed, remove it with `dotnet new uninstall Microsoft.WindowsAppSDK.CSharp.Templates`.
3. Install the freshly packed nupkg: `dotnet new install .\localpackages\Microsoft.WindowsAppSDK.CSharp.Templates.<version>.nupkg`. The `<version>` suffix (for example `0.0.1-experimental`) is controlled by the `<Version>` value in [WinAppSdk.CSharp.DotnetNewTemplates.csproj](WinAppSdk.CSharp.DotnetNewTemplates.csproj#L3-L38), so bump it there when needed.
2. If you already have an older version installed, remove it with `dotnet new uninstall Microsoft.WindowsAppSDK.WinUI.CSharp.Templates`.
3. Install the freshly packed nupkg: `dotnet new install .\localpackages\Microsoft.WindowsAppSDK.WinUI.CSharp.Templates.<version>.nupkg`. The `<version>` suffix (for example `0.0.1-experimental`) is controlled by the `<Version>` value in [WinAppSdk.CSharp.DotnetNewTemplates.csproj](WinAppSdk.CSharp.DotnetNewTemplates.csproj#L3-L38), so bump it there when needed.

## Building the NuGet package

Expand All @@ -42,4 +51,4 @@ the template pack alongside the other Windows App SDK artifacts.

- Windows builds run through [ProjectReunion Template Pack](https://dev.azure.com/microsoft/ProjectReunion/_build?definitionId=186691). To trigger it, first mirror your changes into the internal Foundation repo, then queue the pipeline manually.
- Before running the pipeline, bump the `<Version>` in [WinAppSdk.CSharp.DotnetNewTemplates.csproj](WinAppSdk.CSharp.DotnetNewTemplates.csproj#L3-L38) to avoid conflicts when the “publish to internal feed” option is enabled.
- Successful runs publish the resulting `.nupkg` both as a pipeline artifact and (if that option is selected) to the internal feed [Project.Reunion.nuget.internal](https://dev.azure.com/microsoft/ProjectReunion/_artifacts/feed/Project.Reunion.nuget.internal/NuGet/Microsoft.WindowsAppSDK.CSharp.Templates).
- Successful runs publish the resulting `.nupkg` both as a pipeline artifact and (if that option is selected) to the internal feed [Project.Reunion.nuget.internal](https://dev.azure.com/microsoft/ProjectReunion/_artifacts/feed/Project.Reunion.nuget.internal/NuGet/Microsoft.WindowsAppSDK.WinUI.CSharp.Templates).
128 changes: 100 additions & 28 deletions dev/VSIX/DotnetNewTemplates/WinAppSdk.CSharp.DotnetNewTemplates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
<IsPackable>true</IsPackable>
<PackageType>Template</PackageType>
<PackageId>Microsoft.WindowsAppSDK.CSharp.Templates</PackageId>
<PackageId>Microsoft.WindowsAppSDK.WinUI.CSharp.Templates</PackageId>
<Version>0.0.1-experimental</Version>
<Authors>Microsoft</Authors>
<Company>Microsoft</Company>
Expand All @@ -18,84 +18,156 @@
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageReleaseNotes>See https://github.com/microsoft/WindowsAppSDK/releases for release notes.</PackageReleaseNotes>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<NoWarn>$(NoWarn);NU5128</NoWarn>
<NoWarn>$(NoWarn);NU5128;CS2008</NoWarn>
<PackageOutputPath Condition="'$(PackageOutputPath)' == ''">$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\..\localpackages'))</PackageOutputPath>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="README.md" />
</ItemGroup>

<!-- Single-project template -->
<!-- WinUI Blank App template -->
<ItemGroup>
<None Include="templates\single-project\.template.config\**\*.*"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.SingleProject/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
PackagePath="content/winui.blankapp/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="templates\single-project\Agents.md"
Pack="true"
PackagePath="content/winui.blankapp/Agents.md" />
<None Include="templates\single-project\instructions\**\*.*"
Pack="true"
PackagePath="content/winui.blankapp/instructions/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\ProjectTemplates\Desktop\CSharp\SingleProjectPackagedApp\**\*.*"
Exclude="..\ProjectTemplates\Desktop\CSharp\SingleProjectPackagedApp\bin\**;..\ProjectTemplates\Desktop\CSharp\SingleProjectPackagedApp\obj\**;..\ProjectTemplates\Desktop\CSharp\SingleProjectPackagedApp\Package-managed.appxmanifest;..\ProjectTemplates\Desktop\CSharp\SingleProjectPackagedApp\WinUI.Desktop.Cs.SingleProjectPackagedApp.csproj;..\ProjectTemplates\Desktop\CSharp\SingleProjectPackagedApp\WinUI.Desktop.Cs.SingleProjectPackagedApp.ico;..\ProjectTemplates\Desktop\CSharp\SingleProjectPackagedApp\WinUI.Desktop.Cs.SingleProjectPackagedApp.png;..\ProjectTemplates\Desktop\CSharp\SingleProjectPackagedApp\WinUI.Desktop.Cs.SingleProjectPackagedApp.vstemplate"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.SingleProject/ProjectTemplate/%(RecursiveDir)%(Filename)%(Extension)" />
PackagePath="content/winui.blankapp/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\ProjectTemplates\Desktop\CSharp\SingleProjectPackagedApp\Package-managed.appxmanifest"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.SingleProject/ProjectTemplate/Package.appxmanifest" />
<None Include="templates\single-project\Agents.md"
PackagePath="content/winui.blankapp/Package.appxmanifest" />
</ItemGroup>

<!-- WinUI NavigationView template -->
<ItemGroup>
<None Include="templates\navigation-app\.template.config\**\*.*"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.SingleProject/Agents.md" />
<None Include="templates\single-project\instructions\**\*.*"
PackagePath="content/winui.navview/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\ProjectTemplates\Desktop\CSharp\NavigationApp\**\*.*"
Exclude="..\ProjectTemplates\Desktop\CSharp\NavigationApp\bin\**;..\ProjectTemplates\Desktop\CSharp\NavigationApp\obj\**;..\ProjectTemplates\Desktop\CSharp\NavigationApp\Package-managed.appxmanifest;..\ProjectTemplates\Desktop\CSharp\NavigationApp\WinUI.Desktop.Cs.NavigationApp.csproj;..\ProjectTemplates\Desktop\CSharp\NavigationApp\WinUI.Desktop.Cs.NavigationApp.ico;..\ProjectTemplates\Desktop\CSharp\NavigationApp\WinUI.Desktop.Cs.NavigationApp.png;..\ProjectTemplates\Desktop\CSharp\NavigationApp\WinUI.Desktop.Cs.NavigationApp.vstemplate"
Pack="true"
PackagePath="content/winui.navview/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\ProjectTemplates\Desktop\CSharp\NavigationApp\Package-managed.appxmanifest"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.SingleProject/instructions/%(RecursiveDir)%(Filename)%(Extension)" />
PackagePath="content/winui.navview/Package.appxmanifest" />
</ItemGroup>

<!-- Class library template -->
<!-- WinUI Class Library template -->
<ItemGroup>
<None Include="templates\class-library\.template.config\**\*.*"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.ClassLibrary/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
PackagePath="content/winui.classlib/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\ProjectTemplates\Desktop\CSharp\ClassLibrary\**\*.*"
Exclude="..\ProjectTemplates\Desktop\CSharp\ClassLibrary\bin\**;..\ProjectTemplates\Desktop\CSharp\ClassLibrary\obj\**;..\ProjectTemplates\Desktop\CSharp\ClassLibrary\WinUI.Desktop.Cs.ClassLibrary.csproj;..\ProjectTemplates\Desktop\CSharp\ClassLibrary\WinUI.Desktop.Cs.ClassLibrary.ico;..\ProjectTemplates\Desktop\CSharp\ClassLibrary\WinUI.Desktop.Cs.ClassLibrary.png;..\ProjectTemplates\Desktop\CSharp\ClassLibrary\WinUI.Desktop.Cs.ClassLibrary.vstemplate"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.ClassLibrary/ProjectTemplate/%(RecursiveDir)%(Filename)%(Extension)" />
PackagePath="content/winui.classlib/%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<!-- Unit test template -->
<!-- WinUI Unit Test template -->
<ItemGroup>
<None Include="templates\unit-test\.template.config\**\*.*"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.UnitTest/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
PackagePath="content/winui.unittest/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\ProjectTemplates\Desktop\CSharp\UnitTestApp\**\*.*"
Exclude="..\ProjectTemplates\Desktop\CSharp\UnitTestApp\bin\**;..\ProjectTemplates\Desktop\CSharp\UnitTestApp\obj\**;..\ProjectTemplates\Desktop\CSharp\UnitTestApp\Package-managed.appxmanifest;..\ProjectTemplates\Desktop\CSharp\UnitTestApp\WinUI.Desktop.Cs.UnitTestApp.csproj;..\ProjectTemplates\Desktop\CSharp\UnitTestApp\WinUI.Desktop.Cs.UnitTestApp.ico;..\ProjectTemplates\Desktop\CSharp\UnitTestApp\WinUI.Desktop.Cs.UnitTestApp.png;..\ProjectTemplates\Desktop\CSharp\UnitTestApp\WinUI.Desktop.Cs.UnitTestApp.vstemplate"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.UnitTest/ProjectTemplate/%(RecursiveDir)%(Filename)%(Extension)" />
PackagePath="content/winui.unittest/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\ProjectTemplates\Desktop\CSharp\UnitTestApp\Package-managed.appxmanifest"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.UnitTest/ProjectTemplate/Package.appxmanifest" />
PackagePath="content/winui.unittest/Package.appxmanifest" />
</ItemGroup>

<!-- Blank window item template -->
<!-- WinUI Blank Window item template -->
<ItemGroup>
<None Include="templates\item-blank-window\.template.config\**\*.*"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.Item.BlankWindow/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
PackagePath="content/winui.item.window/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\ItemTemplates\Desktop\CSharp\BlankWindow\BlankWindow.xaml"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.Item.BlankWindow/BlankWindow.xaml" />
PackagePath="content/winui.item.window/BlankWindow.xaml" />
<None Include="..\ItemTemplates\Desktop\CSharp\BlankWindow\BlankWindow.xaml.cs"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.Item.BlankWindow/BlankWindow.xaml.cs" />
PackagePath="content/winui.item.window/BlankWindow.xaml.cs" />
</ItemGroup>

<!-- WinUI Blank Page item template -->
<ItemGroup>
<None Include="templates\item-blank-page\.template.config\**\*.*"
Pack="true"
PackagePath="content/winui.item.page/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\ItemTemplates\Neutral\CSharp\BlankPage\BlankPage.xaml"
Pack="true"
PackagePath="content/winui.item.page/BlankPage.xaml" />
<None Include="..\ItemTemplates\Neutral\CSharp\BlankPage\BlankPage.xaml.cs"
Pack="true"
PackagePath="content/winui.item.page/BlankPage.xaml.cs" />
</ItemGroup>

<!-- WinUI User Control item template -->
<ItemGroup>
<None Include="templates\item-user-control\.template.config\**\*.*"
Pack="true"
PackagePath="content/winui.item.usercontrol/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\ItemTemplates\Neutral\CSharp\UserControl\UserControl.xaml"
Pack="true"
PackagePath="content/winui.item.usercontrol/UserControl.xaml" />
<None Include="..\ItemTemplates\Neutral\CSharp\UserControl\UserControl.xaml.cs"
Pack="true"
PackagePath="content/winui.item.usercontrol/UserControl.xaml.cs" />
</ItemGroup>

<!-- WinUI Templated Control item template -->
<ItemGroup>
<None Include="templates\item-templated-control\.template.config\**\*.*"
Pack="true"
PackagePath="content/winui.item.templatedcontrol/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\ItemTemplates\Neutral\CSharp\TemplatedControl\CustomControl.cs"
Pack="true"
PackagePath="content/winui.item.templatedcontrol/CustomControl.cs" />
</ItemGroup>

<!-- WinUI Resource Dictionary item template -->
<ItemGroup>
<None Include="templates\item-resource-dictionary\.template.config\**\*.*"
Pack="true"
PackagePath="content/winui.item.resourcedictionary/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\ItemTemplates\Neutral\CSharp\ResourceDictionary\ResourceDictionary.xaml"
Pack="true"
PackagePath="content/winui.item.resourcedictionary/ResourceDictionary.xaml" />
</ItemGroup>

<!-- WinUI RESW item template -->
<ItemGroup>
<None Include="templates\item-resw\.template.config\**\*.*"
Pack="true"
PackagePath="content/winui.item.resw/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\ItemTemplates\Neutral\CSharp\Resw\Resources.resw"
Pack="true"
PackagePath="content/winui.item.resw/Resources.resw" />
</ItemGroup>

<!-- Content dialog item template -->
<!-- WinUI Content Dialog item template -->
<ItemGroup>
<None Include="templates\item-content-dialog\.template.config\**\*.*"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.Item.ContentDialog/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="templates\item-content-dialog\ContentDialogItem.xaml"
PackagePath="content/winui.item.dialog/.template.config/%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\ItemTemplates\Neutral\CSharp\ContentDialog\ContentDialog.xaml"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.Item.ContentDialog/ContentDialogItem.xaml" />
<None Include="templates\item-content-dialog\ContentDialogItem.xaml.cs"
PackagePath="content/winui.item.dialog/ContentDialog.xaml" />
<None Include="..\ItemTemplates\Neutral\CSharp\ContentDialog\ContentDialog.xaml.cs"
Pack="true"
PackagePath="content/WinAppSdk.CSharp.Item.ContentDialog/ContentDialogItem.xaml.cs" />
<Compile Remove="templates\item-content-dialog\**" />
PackagePath="content/winui.item.dialog/ContentDialog.xaml.cs" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"$schema": "http://json.schemastore.org/dotnetcli.host",
"$schema": "https://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
"dotnetVersion": {
"longName": "dotnet-version",
"shortName": "tfm"
"shortName": "tfm",
"description": "Base TFM for the WinUI project (for example net10.0)."
}
}
}
Loading