Skip to content

User/muyuanli/naming improvements#6256

Merged
MuyuanMS merged 5 commits intouser/yeelam/miscOnMuyuanBranchfrom
user/muyuanli/namingImprovements
Feb 26, 2026
Merged

User/muyuanli/naming improvements#6256
MuyuanMS merged 5 commits intouser/yeelam/miscOnMuyuanBranchfrom
user/muyuanli/namingImprovements

Conversation

@MuyuanMS
Copy link
Copy Markdown
Contributor

A microsoft employee must use /azp run to validate using the pipelines below.

WARNING:
Comments made by azure-pipelines bot maybe inaccurate.
Please see pipeline link to verify that the build is being ran.

For status checks on the main branch, please use TransportPackage-Foundation-PR
(https://microsoft.visualstudio.com/ProjectReunion/_build?definitionId=81063&_a=summary)
and run the build against your PR branch with the default parameters.

…icrosoft/WindowsAppSDK into user/muyuanli/dotnetnewtemplate

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
…icrosoft/WindowsAppSDK into user/muyuanli/dotnetnewtemplate

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@MuyuanMS MuyuanMS merged commit df120b2 into user/yeelam/miscOnMuyuanBranch Feb 26, 2026
1 check passed
@MuyuanMS MuyuanMS deleted the user/muyuanli/namingImprovements branch February 26, 2026 10:37
MuyuanMS added a commit that referenced this pull request Feb 26, 2026
* Add missing item-content-dialog template for dotnet new

The csproj referenced templates/item-content-dialog/ but the directory
did not exist, which would cause dotnet pack to produce an incomplete
package. Create the template.json, dotnetcli.host.json, and the XAML
and code-behind files for a WinUI 3 ContentDialog item template.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add packaged template to NuGet template pack

The templates/packaged/ directory existed with a full template.json and
solution file but was never included in the csproj ItemGroups, so it
would not ship in the NuGet package. Add the ItemGroup that packs the
template config, solution, BlankApp, and WapProj sources.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update README with packaged and content-dialog templates

The template table was missing the wasdk-packaged and wasdk-item-dialog
entries. Add both so the README accurately documents all templates
shipped in the pack.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add language and type tags to all template.json files

Without the 'tags' property, 'dotnet new list' does not show the
language column and template discoverability is reduced. Add
tags.language=C# and tags.type (project, solution, or item) to every
template.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add postActions for automatic NuGet restore

After 'dotnet new' creates a project, the user currently has to
manually run 'dotnet restore'. Add the standard NuGet restore post-
action (actionId 210D431B) to the four project templates so packages
are restored automatically. Item templates do not need this.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add Windows-only OS constraint to all templates

WinUI 3 / Windows App SDK templates only work on Windows. Without the
constraint, 'dotnet new list' shows them on Linux and macOS where they
cannot build, leading to confusing errors. Add the os constraint so
the templates are hidden on non-Windows hosts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add description fields to template parameters

The single-project, class-library, and unit-test templates were missing
description fields on their user-facing parameters. The packaged
template already had them. Add matching descriptions so 'dotnet new
<template> --help' displays useful parameter documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add description fields to dotnetcli.host.json files

The packaged template's host file already had descriptions but the
single-project, class-library, unit-test, and item-blank-window host
files did not. Add descriptions so 'dotnet new <template> --help'
displays useful help text for every parameter.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add Copyright, license acceptance, and release notes to csproj

The NuGet package was missing Copyright, PackageRequireLicenseAcceptance,
and PackageReleaseNotes metadata. Add them for completeness and better
presentation on NuGet feeds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update default dotnetVersion from net8.0 to net9.0

.NET 9.0 is the current release. Update the default TFM across all
four project templates and their dotnetcli.host.json description
examples. Users can still override with --dotnet-version net8.0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Use https:// for JSON schema URLs

All template.json and dotnetcli.host.json files used http:// for the
schema store URLs. Update to https:// for consistency and security.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Revert packaged template from dotnet new pack

The wasdk-packaged template uses a WAP project (.wapproj) which the
dotnet CLI does not understand, so it cannot be used with 'dotnet new'.
Remove the packaged template ItemGroup from the csproj, remove it from
the README, and restore its template.json and dotnetcli.host.json to
their pre-modification state.

This reverts the packaged-related portions of commits 31f65f2,
b8c76b7, 80c1b8f, 63d5abf, ff0bc38, 7c03a19, and 4891155.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Use existing VS ContentDialog sources instead of hand-crafted copies

The ContentDialog XAML and code-behind already exist at
ItemTemplates/Neutral/CSharp/ContentDialog/. Link those files in the
csproj instead of maintaining separate copies, matching the pattern
used by the BlankWindow item template. This keeps a single source of
truth and preserves the original button click handlers.

Also update template.json sourceName and primaryOutputs to match the
original filenames (ContentDialog, not ContentDialogItem), and remove
the now-unnecessary Compile Remove directive.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Align packaged template config with other templates

The previous revert restored the packaged template.json and
dotnetcli.host.json to their original state, making them inconsistent
with the rest of the templates. Re-apply the same improvements: add
tags, constraints, postActions, update schema to https://, and default
TFM to net9.0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove templates/packaged/ directory

The packaged template uses a WAP project (.wapproj) which the dotnet
CLI does not support, so it is not included in the NuGet template pack.
Remove the unused directory to avoid confusion.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update default dotnetVersion from net9.0 to net10.0

.NET 10.0 is the latest officially supported version. Update the
default TFM and help text examples across all project templates.
Users can still override with --dotnet-version net8.0 or net9.0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rename template shortNames from wasdk-* to winui3-*

Use winui3- prefix instead of wasdk- since WinUI 3 is the product
name users recognize, not the shipping vehicle (Windows App SDK).

  wasdk-single        -> winui3
  wasdk-classlib      -> winui3-lib
  wasdk-unittest      -> winui3-unittest
  wasdk-item-blankwin -> winui3-window
  wasdk-item-dialog   -> winui3-dialog

Also update display names and default project names to match.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add winui3-page and winui3-usercontrol item templates

Add two new item templates that link existing VS template sources from
ItemTemplates/Neutral/CSharp/:

  winui3-page        - BlankPage (Page with XAML and code-behind)
  winui3-usercontrol - UserControl (UserControl with XAML and code-behind)

Both follow the same pattern as winui3-window and winui3-dialog: the
template.config is maintained locally while XAML/code-behind are linked
from the shared VS template sources.

Note: the dotnet new template engine does not support verifying that an
existing project exists before adding an item template. The
msbuild:RootNamespace binding will fall back to the default value if no
project is found.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add project-capability and sdk-version constraints to item templates

Item templates (window, page, usercontrol, dialog) should only appear
in 'dotnet new list' when run inside a C# project folder. Add a
'project-capability' constraint with 'CSharp' so the templates are
hidden when no C# project is found in the current directory. Also add
an sdk-version constraint requiring .NET 8.0 or later.

Inspired by https://github.com/egvijayanand/winui-templates which uses
the same approach.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add sdk-version constraint to project templates

Require .NET 8.0 SDK or later for the three project templates
(single-project, class-library, unit-test). The templates target
net10.0-windows and will not work on older SDKs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(project): update NoWarn property to include CS2008 warning

* feat(templates): update template identities to use WinUI naming convention

* feat(templates): add symbols section to various template configurations

* feat(templates): update dotnetVersion to support .NET 8, 9, and 10 choices

* template renamings

* User/muyuanli/naming improvements (#6256)

* template renamings

* Update naming and schema

* Add back agents and instructions

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Muyuan Li (from Dev Box) <muyuanli@microsoft.com>
Co-authored-by: Muyuan Li <116717757+MuyuanMS@users.noreply.github.com>
DinahK-2SO pushed a commit that referenced this pull request Apr 20, 2026
* Add missing item-content-dialog template for dotnet new

The csproj referenced templates/item-content-dialog/ but the directory
did not exist, which would cause dotnet pack to produce an incomplete
package. Create the template.json, dotnetcli.host.json, and the XAML
and code-behind files for a WinUI 3 ContentDialog item template.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add packaged template to NuGet template pack

The templates/packaged/ directory existed with a full template.json and
solution file but was never included in the csproj ItemGroups, so it
would not ship in the NuGet package. Add the ItemGroup that packs the
template config, solution, BlankApp, and WapProj sources.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update README with packaged and content-dialog templates

The template table was missing the wasdk-packaged and wasdk-item-dialog
entries. Add both so the README accurately documents all templates
shipped in the pack.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add language and type tags to all template.json files

Without the 'tags' property, 'dotnet new list' does not show the
language column and template discoverability is reduced. Add
tags.language=C# and tags.type (project, solution, or item) to every
template.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add postActions for automatic NuGet restore

After 'dotnet new' creates a project, the user currently has to
manually run 'dotnet restore'. Add the standard NuGet restore post-
action (actionId 210D431B) to the four project templates so packages
are restored automatically. Item templates do not need this.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add Windows-only OS constraint to all templates

WinUI 3 / Windows App SDK templates only work on Windows. Without the
constraint, 'dotnet new list' shows them on Linux and macOS where they
cannot build, leading to confusing errors. Add the os constraint so
the templates are hidden on non-Windows hosts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add description fields to template parameters

The single-project, class-library, and unit-test templates were missing
description fields on their user-facing parameters. The packaged
template already had them. Add matching descriptions so 'dotnet new
<template> --help' displays useful parameter documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add description fields to dotnetcli.host.json files

The packaged template's host file already had descriptions but the
single-project, class-library, unit-test, and item-blank-window host
files did not. Add descriptions so 'dotnet new <template> --help'
displays useful help text for every parameter.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add Copyright, license acceptance, and release notes to csproj

The NuGet package was missing Copyright, PackageRequireLicenseAcceptance,
and PackageReleaseNotes metadata. Add them for completeness and better
presentation on NuGet feeds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update default dotnetVersion from net8.0 to net9.0

.NET 9.0 is the current release. Update the default TFM across all
four project templates and their dotnetcli.host.json description
examples. Users can still override with --dotnet-version net8.0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Use https:// for JSON schema URLs

All template.json and dotnetcli.host.json files used http:// for the
schema store URLs. Update to https:// for consistency and security.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Revert packaged template from dotnet new pack

The wasdk-packaged template uses a WAP project (.wapproj) which the
dotnet CLI does not understand, so it cannot be used with 'dotnet new'.
Remove the packaged template ItemGroup from the csproj, remove it from
the README, and restore its template.json and dotnetcli.host.json to
their pre-modification state.

This reverts the packaged-related portions of commits 31f65f2,
b8c76b7, 80c1b8f, 63d5abf, ff0bc38, 7c03a19, and 4891155.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Use existing VS ContentDialog sources instead of hand-crafted copies

The ContentDialog XAML and code-behind already exist at
ItemTemplates/Neutral/CSharp/ContentDialog/. Link those files in the
csproj instead of maintaining separate copies, matching the pattern
used by the BlankWindow item template. This keeps a single source of
truth and preserves the original button click handlers.

Also update template.json sourceName and primaryOutputs to match the
original filenames (ContentDialog, not ContentDialogItem), and remove
the now-unnecessary Compile Remove directive.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Align packaged template config with other templates

The previous revert restored the packaged template.json and
dotnetcli.host.json to their original state, making them inconsistent
with the rest of the templates. Re-apply the same improvements: add
tags, constraints, postActions, update schema to https://, and default
TFM to net9.0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove templates/packaged/ directory

The packaged template uses a WAP project (.wapproj) which the dotnet
CLI does not support, so it is not included in the NuGet template pack.
Remove the unused directory to avoid confusion.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update default dotnetVersion from net9.0 to net10.0

.NET 10.0 is the latest officially supported version. Update the
default TFM and help text examples across all project templates.
Users can still override with --dotnet-version net8.0 or net9.0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Rename template shortNames from wasdk-* to winui3-*

Use winui3- prefix instead of wasdk- since WinUI 3 is the product
name users recognize, not the shipping vehicle (Windows App SDK).

  wasdk-single        -> winui3
  wasdk-classlib      -> winui3-lib
  wasdk-unittest      -> winui3-unittest
  wasdk-item-blankwin -> winui3-window
  wasdk-item-dialog   -> winui3-dialog

Also update display names and default project names to match.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add winui3-page and winui3-usercontrol item templates

Add two new item templates that link existing VS template sources from
ItemTemplates/Neutral/CSharp/:

  winui3-page        - BlankPage (Page with XAML and code-behind)
  winui3-usercontrol - UserControl (UserControl with XAML and code-behind)

Both follow the same pattern as winui3-window and winui3-dialog: the
template.config is maintained locally while XAML/code-behind are linked
from the shared VS template sources.

Note: the dotnet new template engine does not support verifying that an
existing project exists before adding an item template. The
msbuild:RootNamespace binding will fall back to the default value if no
project is found.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add project-capability and sdk-version constraints to item templates

Item templates (window, page, usercontrol, dialog) should only appear
in 'dotnet new list' when run inside a C# project folder. Add a
'project-capability' constraint with 'CSharp' so the templates are
hidden when no C# project is found in the current directory. Also add
an sdk-version constraint requiring .NET 8.0 or later.

Inspired by https://github.com/egvijayanand/winui-templates which uses
the same approach.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add sdk-version constraint to project templates

Require .NET 8.0 SDK or later for the three project templates
(single-project, class-library, unit-test). The templates target
net10.0-windows and will not work on older SDKs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(project): update NoWarn property to include CS2008 warning

* feat(templates): update template identities to use WinUI naming convention

* feat(templates): add symbols section to various template configurations

* feat(templates): update dotnetVersion to support .NET 8, 9, and 10 choices

* template renamings

* User/muyuanli/naming improvements (#6256)

* template renamings

* Update naming and schema

* Add back agents and instructions

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Muyuan Li (from Dev Box) <muyuanli@microsoft.com>
Co-authored-by: Muyuan Li <116717757+MuyuanMS@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant