Skip to content

fix #50008 by bumping precedence so the 10 template is treated as the primary #50154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2025

Conversation

baronfel
Copy link
Member

@baronfel baronfel commented Aug 9, 2025

Fixes #50008

Templates are parsed from all configured providers, and then grouped by 'groupIdentity' into TemplateGroups.
When a template is instantiated, the TemplateGroup is chosen based on the identity of the template provided by the user in the command, and then the Templates in the TemplateGroup are ordered by Precedence and the maximum one is chosen for parsing all of the rest of the arguments to the template.

In general, the problem in #50008 doesn't happen with the 'core' project templates because we bump the template precedence each release. We haven't done this with the item templates because they generally haven't changed much and it's not been part of our muscle memory. We should make this a thing in the future for any template changes - in fact we should probably just keep item template precedence in line with the project template precedence.

@Copilot Copilot AI review requested due to automatic review settings August 9, 2025 17:56
@baronfel baronfel requested a review from a team as a code owner August 9, 2025 17:56
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issue #50008 by increasing the precedence value of the Solution template from 100 to 101, ensuring it is treated as the primary template when multiple templates with the same group identity exist.

  • Bumped template precedence from 100 to 101 for the Solution template

@github-actions github-actions bot added the Area-Common templates Covers templates in the repo (classlib, console, common item templates) label Aug 9, 2025
@baronfel baronfel requested a review from a team August 10, 2025 13:45
@baronfel baronfel merged commit ba38f1a into dotnet:main Aug 10, 2025
28 checks passed
@baronfel baronfel deleted the fix-sln-template-precedence branch August 10, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Common templates Covers templates in the repo (classlib, console, common item templates)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dotnet new sln "--format" missing in 10.0.100 preview (--format slnx broken)
2 participants