-
-
Notifications
You must be signed in to change notification settings - Fork 970
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 .NET 10 support #2642
base: master
Are you sure you want to change the base?
Add .NET 10 support #2642
Conversation
64dc9bb
to
da35b1c
Compare
da35b1c
to
3357418
Compare
I've tested this PR against a local build from dotnet/runtime#106599 and it fails because it seems that the .NET 10 SDK doesn't actually allow to target .NET 10, rather it only allows targetting .NET 9. To get things to work we do need to make changes to the SDK validator to allow backwards compatibility. However, this change will still be useful to have in once we do have .NET 10 targeting supported |
Yup, it's a chicken-egg situation atm, and we will soon be on alpha1 in runtime repo (based on how it was done last year, around this time). I think we can pass --corerun option in local builds that points to built corerun under |
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.
GitHub won't let me add a comment on the actual line... I think the TryParse
method needs to be updated to account for the underscore.
internal static bool TryParse(string runtime, out RuntimeMoniker runtimeMoniker)
{
int index = runtime.IndexOf('-');
if (index >= 0)
{
runtime = runtime.Substring(0, index);
}
// Monikers older than Net 10 don't use any version delimiter, newer monikers use _ delimiter.
if (Enum.TryParse(runtime.Replace(".", string.Empty), ignoreCase: true, out runtimeMoniker))
{
return true;
}
return Enum.TryParse(runtime.Replace('.', '_'), ignoreCase: true, out runtimeMoniker);
}
I don't have a 10.0 sdk version, so I didn't test.
[InlineData("net70")] | ||
[InlineData("net80")] | ||
[InlineData("net90")] | ||
[InlineData("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.
[InlineData("net70")] | |
[InlineData("net80")] | |
[InlineData("net90")] | |
[InlineData("net10_0")] | |
[InlineData("net7.0")] | |
[InlineData("net8.0")] | |
[InlineData("net9.0")] | |
[InlineData("net10.0")] |
IMHO the best direction would be to introduce something similar to the This transition to .NET 10.0 might be an ideal time to consider such a change and start deprecating the old enum, with the goal of fully removing it after a few release cycles. Additionally, pseudo-TFMs like |
I don't understand how |
This strongly-typed enums based implementation is not scaling very well; but for now, lets add 10.0 and soon after lets see if we can make it less verbose to ease up future updates a bit: dotnet/runtime#106599 (comment)
cc @adamsitnik, @lewing