-
Notifications
You must be signed in to change notification settings - Fork 255
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
warn on netcoreapp{5,6,7...} #12351
Comments
Issue is missing Type label, remember to add a Type label |
Team Triage: Consider this work for .NET 8 since it would be a breaking change to warn/error when using netcoreapp |
here are some github stats: netcoreapp5.0: https://grep.app/search?q=netcoreapp5&case=true (210) warning these few people is much better than papering over their mistakes. new c# / roslyn versions introduce these kind of warnings all the time where previous version was fine with code and after the toolchain update, there are warnings and errors. there is no need to "play nice" with silly mistakes made by users. in addition to netcoreapp7.0 and netcoreapp70, nuget also parses netcoreapp7 (wrong name, without minor version). this is just too much parsing work for no good justification. the "issue" is that since nuget is walking extra miles nobody asked for, msbuild, sdk and vs are also blindly supporting the wrong forms. that forces third party implementations working with project files to also support all kinds of weird forms. so it actually hurting the ecosystem.
ok. so after parsing .net 7 and warning for bad forms, let it be an error for .net 8+ if tfm does not start with |
I'm not opposed to suggesting customers use the recommended values, but I feel like the last comment escalated in language significantly. Is there something behind this? Kind of like an XY problem?
that's not technically true: https://github.com/dotnet/designs/blob/main/accepted/2020/net5/net5.md#why-is-net-50s-tfi-still-mapped-to-netcoreapp
Claiming "walking extra miles" feels wrong, at least as someone who was there since before the Anyway, the current design is that TargetFrameworks are just aliases. The .NET Project System's public coding guidelines document explicitly tells contributors not to try to parse So, anyone making assumptions about So, today this works just fine and is completely valid: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>Prod;Preview</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'Prod' ">
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
<TargetFrameworkVersion>6.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'Preview' ">
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
<TargetFrameworkVersion>7.0</TargetFrameworkVersion>
</PropertyGroup>
</Project> This is a multi-targeting I never talked to the BenchmarkDotNet people about this, but I think once NuGet properly supports TFM aliases, it'd be great to be able to do perf benchmarks between two different versions of a package (on the same runtime) in this way. Currently we have to run the benchmark multiple times and then manually merge the results and manually calculate ratios. |
netcoreapp was replaced with net since v5.
nuget should issue a deprecation warning or error when
<TargetFramework>netcoreapp7.0</TargetFramework>
etc. are encountered, instead of allowing the wrong tfms forever: https://github.com/NuGet/NuGet.Client/blob/4a6b7bbad3fb31eb6d8c5a4242649419dedd0f29/src/NuGet.Core/NuGet.Frameworks/NuGetFrameworkFactory.cs#L689 the only valid form for modern versions isnet<major>.<minor>
, all other forms are "wrong" on user-end and easy to fix.The text was updated successfully, but these errors were encountered: