-
Notifications
You must be signed in to change notification settings - Fork 161
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
Add initial design document for parsing net10
#322
base: main
Are you sure you want to change the base?
Conversation
This relates to my question before Since we're going to use https://github.com/dotnet/designs/blob/main/accepted/2020/net5/net5.md#what-about-net-10 Why not just treat the It would also introduce the complexity and inconsistency across SDKs versions |
To be clear, This proposal is about how we should address the problem that some people will use |
I think we shouldn’t support this non-standard target framework, and someone’s already brought up issues with it. |
Is this change just for TargetFramework in MSBuild? There are net10 and net11 packages on NuGet.org--would they magically become .NET 10 packages? |
If even first-party tools msbuild and nuget don't handle this properly, shouldn't this sound the alarm that third-party ecosystem tools also won't handle it properly? It seems like us special-casing (Edit: This is just a random opinion. Not a hill I'm willing to spend much effort defending. 🙂) |
What do you mean by this?
So what about |
Co-authored-by: Kexy Biscuit <[email protected]>
Co-authored-by: Kexy Biscuit <[email protected]>
A retrocompute question - is it ever possible to build for .NET Framework 1.0 with current .NET SDK? I'd suggest to keep |
I don't believe so because .NET Framework 1.x doesn't even have a targeting pack; those came to be with .NET Framework 2.0. |
Depends on what you mean. ".NET 10" has never been supported by virtue of the .NET 10 product and SDK never existing. Unless I misread your doc, ".NET Framework 1.0" has not been supported by modern toolchains for years. This seems like a case where
I only suggested that the target framework |
The project file/SDK didn't invent the framework syntax, we simply made it the NuGet syntax. As a result, you can put
Gotcha. I just updated the PR description. Does the last sentence represent your proposal then? If so, I'd be OK with that too. |
Yup! Thanks. :) Again - I'm not terribly passionate one way or another. It's just a proposal for others' consideration. Your doc is very well thought through. |
Would it possible / make sense to make nuget.org reject packages that use the old format without periods? In particular for Also this page should be updated to use periods: https://learn.microsoft.com/en-us/dotnet/standard/frameworks (and probably other doc pages too). |
Here is the proposal: | ||
|
||
* Make `net10` mean .NET 10 and `net11` mean .NET 11 but keep all higher | ||
versions as-is (`net20` still means .NET Framework 2.0). |
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 seems backwards to me. if the goal is to eventually guide people to always use periods then I don't think we should complicate our lives by allowing net10
and potentially cause more issues in downstream tools that parse the version.
I'd change the rule to:
- Warn about missing dot for (currently) non-ambigious versions like net20, net472
- Error for ambigious versions like net10, net11.
And change to error everywhere in net12 like you suggested (or wait until net20 when that becomes ambigious?).
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.
- Warn about missing dot for (currently) non-ambigious versions like net20, net472
We don't have any alternatives to net20
or net472
to fix the warning, do we? If not, we shouldn't warn for those.
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.
you can use net2.0
and net4.7.2
instead.
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.
TIL
Could it be an idea to make it a warning by default but an opt-in error? |
How about |
That's it, it would introduce the complexity and inconsistency across SDKs versions. Do not think it's worth making these changes for a usage that should not be used If we want to produce a warning before producing an error directly, would it be applicable to produce a warning for |
That's a good point. It should be easy because NuGet tooling could already normalize the syntax. |
I don't think it's practical to make such a change before .NET 9 GA. We could, however, likely make that change to the SDK post GA (because the SDK versions gets shipped more frequently). It's probably considered a source breaking change, but I'd consider that acceptable. |
I'm not sure we need to do anything for nuget.org or nuget packages, |
That's a fair point actually. |
The "GitHub Usage of a Framework" does not include .NET Framework IDs. The percent of occurrences of IDs without dots is much higher:
I still think the design is reasonable, as the number of occurrences of .NET Framework target framework IDs is much lower compared to .NET and .NET Standard IDs. |
My goal is not establish
netX.Y
as the normative syntax.At the same time, I don't want to break existing people. While nobody in their right mind would target .NET Framework 1.0 anymore, targeting, say, .NET Framework 4.7.2 via the syntax
net472
is not just extremely common, it's the de-facto norm.With .NET 10, we have justification to make the lack of a period a warning. Making it an error feels overly aggressive.
In order to make this warning pop for all projects, it seems the least impactful thing is to make
net1X
parse likenet1X.0
(therefore binding to the framework virtually everyone would expect in 2024). If we don't, thennet10
will bind to mean .NET Framework 1.0 and cause cascading errors that hide the warning, leaving most customers confused.The alternative to making it parse would be to fail
net1X
as a parse error, rather than letting it bind as .NET Framework 1.X.