Skip to content
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

Update project template precedence values #44479

Merged
merged 1 commit into from
Oct 12, 2022

Conversation

MackinnonBuck
Copy link
Member

Update project template precedence values

When .NET 6 and .NET 7 are installed side-by-side, some item templates cannot be created via dotnet new. This PR fixes the issue by giving the 7.0 templates higher precedence.

Description

Attempting to run dotnet new using one of the affected project templates (e.g. "page") results in the following error:

Unable to resolve the template, the following installed templates are conflicting:
Identity                                Template Name  Short Name  Language  Precedence  Author     Package
--------------------------------------  -------------  ----------  --------  ----------  ---------  -------
Microsoft.AspNetCore.Mvc.RazorPage.6.0  Razor Page     page        C#        600         Microsoft
Microsoft.AspNetCore.Mvc.RazorPage.7.0  Razor Page     page        C#        600         Microsoft

Uninstall the template packages containing the templates to keep only one template from the list or add the template options which differentiate the template to run.

The fix is to update the "precedence" values for each template to correlate with the major version (e.g. 700 for .NET 7).

Customer Impact

Without this fix, customers would not be able to use dotnet new with any of the templates defined in Web.ItemTemplates or Web.Client.ItemTemplates if .NET 6 and .NET 7 are installed side-by-side.

Regression?

  • Yes
  • No

This is a new bug that occurs when .NET 6 and .NET 7 are installed side-by-side.

Risk

  • High
  • Medium
  • Low

This PR changes a single value for each affected template configuration. We've already updated the precedence values for other templates and haven't seen any problems arise from that change.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Oct 11, 2022
@mkArtakMSFT mkArtakMSFT added the Servicing-consider Shiproom approval is required for the issue label Oct 11, 2022
@ghost
Copy link

ghost commented Oct 11, 2022

Hi @MackinnonBuck. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge.

To learn more about how to prepare a servicing PR click here.

@mkArtakMSFT mkArtakMSFT added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Oct 11, 2022
@MackinnonBuck
Copy link
Member Author

MackinnonBuck commented Oct 12, 2022

@dotnet/aspnet-admins Would you be able to merge this please? Thanks.

UPDATE: There is some discussion offline about the general direction we should take with the template configuration. Let's hold off merging until that conversation concludes.

@MackinnonBuck MackinnonBuck added the * NO MERGE * Do not merge this PR as long as this label is present. label Oct 12, 2022
@dougbu
Copy link
Member

dougbu commented Oct 12, 2022

I think we're ready to merge this. Agreed @MackinnonBuck❔ If yes, remove *NO MERGE*😁

@MackinnonBuck MackinnonBuck removed the * NO MERGE * Do not merge this PR as long as this label is present. label Oct 12, 2022
@MackinnonBuck
Copy link
Member Author

I agree, let's merge this. Thanks!

@dougbu dougbu merged commit 866570a into release/7.0 Oct 12, 2022
@dougbu dougbu deleted the mbuck/update-template-precedence branch October 12, 2022 18:37
@dougbu dougbu added this to the 7.0.0 milestone Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants