-
Notifications
You must be signed in to change notification settings - Fork 162
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). |
accepted/2024/net10.md
Outdated
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
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.
Agreed. I've changed the proposal.
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. |
Co-authored-by: Igor Velikorossov <[email protected]>
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.
LGTM but the issue description needs to be updated to reflect the current proposal.
Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
|
||
## Q & A | ||
|
||
### What about `net10.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.
Is this q&a still relevant? The answer seems to be referring to the original proposal.
ref. dotnet/designs#322: > We want to steer people towards a proper version syntax, that is > > ```xml > <TargetFramework>netX.Y.Z</TargetFramework> > ``` > > Examples include `net9.0`, `net10.0`, `net4.5.1`. This syntax makes it unambiguous.
ref. dotnet/designs#322: > We want to steer people towards a proper version syntax, that is > > ```xml > <TargetFramework>netX.Y.Z</TargetFramework> > ``` > > Examples include `net9.0`, `net10.0`, `net4.5.1`. This syntax makes it unambiguous.
I've been busy submitting PRs to enforce correct framework versioning across projects, promoting the only documented Here’s why:
Given that only about 0.01% of GitHub projects use these non-standard variants, updating to |
We want to steer people towards a proper version syntax, that is
Examples include
net9.0
,net10.0
,net4.5.1
. This syntax makes it unambiguous.Proposal:
net10
ornet11
with an error messagenet10
nornet11
, produce a warning if it doesn't contain a period:The reason to fail the build is because in practice someone trying to target .NET Framework 1.0 will most likely fail anyway because the either don't have the .NET Framework 3.5 targeting pack -- or worse -- they do, but the code doesn't compile because it's meant for modern .NET Core, not a 25 year old .NET Framework 1.0. By failing early it turns an unintelligible error message into something actionable.
The reason to issue the warning is to avoid any ambiguities moving forward.
Note
Please note that this change only applies to the .NET Core SDK, i.e. SDK-style projects. Old school .NET Framework CSPROJ files will be unaffected by this change because the representation of the target framework is already a proper version string.