-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
How to create projects that target earlier frameworks #25603
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM @tdykstra
I had one question that we should address if it's a quick change.
@@ -88,6 +92,8 @@ Each template may have additional options available. The core templates have the | |||
|
|||
Specifies the [framework](../../standard/frameworks.md) to target. Values: `net5.0` or `netcoreapp<version>` to create a .NET Class Library or `netstandard<version>` to create a .NET Standard Class Library. The default value for .NET 5.0 SDK is `net5.0`. | |||
|
|||
To create a project that targets a framework earlier than the SDK that you're using, see [`--framework` for `console` projects](#template-options) earlier in this article. | |||
|
|||
- **`--langVersion <VERSION_NUMBER>`** | |||
|
|||
Sets the `LangVersion` property in the created project file. For example, use `--langVersion 7.3` to use C# 7.3. Not supported for F#. Available since .NET Core 2.2 SDK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to your PR, but we should make an explicit statement about VB support for --langVersion.
@tdykstra could we please take a pause on this PR to discuss it? It seems that different templates owners have different rules:
Adding @KathleenDollard and @DamianEdwards here for discussion. |
Ideally all templates should be updating to use the template identifier to produce a package per version and accept the framework version as an option, along with publishing all versions to NuGet.org. As I understand it, that way the templating engine can discover and suggest the correct package when a framework option value is passed that isn't supported by any installed templates, but is supported by a template in a package on NuGet.org. This is how the web templates work. |
I agree that moving to a single approach (package per TFM, available on NuGet) would be extremely helpful. I think for Microsoft templates we just move this direction as fast as the teams can manage it. This seems overly complex for third party template authors. I think if templates are delivered to NuGet separately, the single package approach makes sense for these templates. Adding that so template authors happening upon this aren't confused and to clarify with Tom. @vlada-shubina when we complete that approach, then will @tdykstra text be correct? |
imo, both single package and package per TFM approaches are possible and have their pros and cons; it's more about finding a common ground here.
This is not a case anymore, we removed implicit templates search on template instantiation to avoid unnecessary delays on searching. Potentially we can enable behavior when the user can do the search to check for package availability:
Definitely agree, we should recommend creating single package for template authors in all tutorials. However should also probably give an explanation of advanced scenario too (template grouping was highlighted as understanding pain point in couple issues already).
Tom's text is correct.
|
With your reordering of the options applied, is this correct for the current state of things, meaning we could merge this PR and revise the text when we make the changes under discussion? Or hold the PR open until then? |
Fine with me. I will open the tickets to test-templates, wpf and winforms repos (those that are not available on NuGet.org and following different packaging approach) tomorrow to continue discussion. |
Fixes #24544