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

Cannot specify specific OS version TFM in dotnet new #4638

Open
dotMorten opened this issue Apr 22, 2022 · 1 comment
Open

Cannot specify specific OS version TFM in dotnet new #4638

dotMorten opened this issue Apr 22, 2022 · 1 comment
Assignees
Labels
area: template-content The issue is related to content of template packages managed in this repo (/template_feed) triaged The issue was evaluated by the triage team, placed on correct area, next action defined.
Milestone

Comments

@dotMorten
Copy link

dotMorten commented Apr 22, 2022

With dotnet new wpf I can specify either net6.0, net5.0, netcoreapp3.0 or netcoreapp3.1. The odd thing though is that if you specify net6.0 you actually get net6.0-windows.
However I wanted to specify a TFM a bit more specific than the default, so I used net6.0-windows10.0.19041.0, which is a valid TFM for the WPF template, however I'm met with the following:

image

Could the -f parameter be a little smarter and allow me to be more specific than the allowed TFMs, as long as it is a subset of them?

@vlada-shubina vlada-shubina added the need-pm-discussion Need agreement from PM that the issue aligns to targeted stories for any of the next 2 releases label Apr 26, 2022
@baronfel baronfel self-assigned this Apr 26, 2022
@baronfel baronfel added triaged The issue was evaluated by the triage team, placed on correct area, next action defined. and removed need-pm-discussion Need agreement from PM that the issue aligns to targeted stories for any of the next 2 releases labels Apr 26, 2022
@baronfel baronfel added this to the Backlog milestone Apr 26, 2022
@baronfel
Copy link
Member

This is very closely related to #4159.

The core issue that prevents a quick and easy solution is that the TFM is used not only in template generation (what we call 'instantiation') but also in template selection. Templates are grouped by a (GroupIdentity, TFM) tuple, because historically we've changed template contents based on the TFM. Adding the ability to specify the newer, platform-specific TFMs would require us to make changes to the template selection code to do a kind of 'template TFM supports user TFM' check. This is a fairly invasive change that will require a lot of testing.

We've seen a number of issues popping up related to TFMs and how they interact with template selection and instantiation that lead to a poor user experience. Our current plan is to solve them at the root by disentangling TFMs from the generation process with a new template generator geared for .NET projects specifically, instead of the very generic generator we're currently using. That work is tracked by this epic. In the interim, the workaround I can suggest is to generate the project and change the TFM after the project is generated.

@YuliiaKovalova YuliiaKovalova added the area: template-content The issue is related to content of template packages managed in this repo (/template_feed) label May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: template-content The issue is related to content of template packages managed in this repo (/template_feed) triaged The issue was evaluated by the triage team, placed on correct area, next action defined.
Projects
None yet
Development

No branches or pull requests

4 participants