-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Drop support for .NET Standard #107081
Comments
Tagging subscribers to this area: @dotnet/area-meta |
.NET Standard 2.0 is necessary for .NET Framework (and maybe https://gitlab.winehq.org/wine-mono/mono) Unity is currently moving to .NET (Core), when that transition is done you could deprecate 2.1, but 2.0 isn't going anywhere soon. We still have Microsoft products that use .NET Framework. There is not an EOL of .NET Framework yet, but if there will be it'll fall under the OS lifecycle. For Windows Server 2022 that's in 2031. Visual Studio 2022 also uses .NET Framework and is EOL in 2032. And there are a lot of applications outside Microsoft that still use .NET Framework. Multi-targeting .NET Framework and .NET (Core) brings other problems:
With multi-targeting .NET Standard and .NET (Core) you don't have these problems. |
While WebForms is still officially supported, I just cannot agree with this. If NET Standard was dropped, it would dramatically restrict our ability to share modern code with our old ASP.NET WebForms project. |
According to the document, the mono corresponding to Netstandard will not receive investment in the future, and xamarin. * also ended support on May 1st this year, so it is time to abandon Netstandard support. |
are they moving to .net core or have they moved already in their latest releases? if windows server 2025 and 2028 are also going to use .net framework, then it's "not before 2050 (at least)" or "never". companies who haven't moved from web form era will continue to stick with "whatever works" policy, those are not worth the continuous support. |
Using these packages is untested if the target framework is older than the minimum supported version. Lines 121 to 133 in 8d24ba3
|
@kasperk81 now it is a multi targetframework, and the. NET framework is not affected, |
Existing .NET Standard versions will be supported forever, because we need to load everything that's loadable now. There's nothing actionable here. |
Our strategy follows what you're asking us to do: by default, new features are only available in However, we still need to support .NET Framework customers. While we don't ship new versions of .NET Framework, we do maintain a set of libraries that can be consumed from .NET Framework. We do this for various reasons:
And based on customer requests we make other components available as .NET Standard packages well. Practically, I don't see this change any time soon -- .NET Framework will likely be supported for as long as Windows is supported. And as long as a ton of our customers use it, we'll likely have to make some features available for it. |
@terrajobst I don't understand why removing Line 4 in 063ae05
|
Are you asking why we don't just drop support for building for .NET Standard in this repo if we can just multi-target between .NET Core and .NET Framework? If so, then the reason is simply to allow customers to build a single library for both .NET Framework and .NET Core. As soon as we only ship multi-targeted packages here then everyone will have to multi-target. Multi-targeting is a lot harder than targeting .NET Standard 2.0. |
The goals corresponding to Netstandard 2.0 have all ended support. Is it really necessary to support it? This is a thought-provoking question.
|
SQL client has recently droped support for netstandard |
There is no new version of .NET Standard; 2.1 was the final version and 2.0 is the last version implemented by .NET Framework. Hence, if you want to build a library that works on both .NET Framework and .NET Core, you need to target .NET Standard 2.0. If you want to build a binary that supports .NET Framework and .NET Core, then you might as well build for .NET Standard 2.0 as the API intersection between .NET Core/.NET Framework is effectively the same, but you don't need to build twice and bloat your package. |
You can see from nuget that the most downloaded packages do not use netstandard for single-target framework, but are multi-target frameworks |
Wasn't it the point that multi-targeting is much harder (on the library developer) than just targeting .NET Standard 2.0? If you don't have a super advanced library and want to easily target both new and "full" framework, surely you'd opt for targeting .NET Standard 2.0. |
transitioning from: <TargetFramework>netstandard2.0</TargetFramework> to: <TargetFrameworks>net47;net8.0</TargetFrameworks> isn't necessarily complicating the project. when dealing with more complex scenarios, where different frameworks have specific requirements or features, you might indeed need to incorporate conditional compilation (#if NET #if !NET). but the VS experience is pretty much the same: "API is not available in .NET Standard" build error becomes "not all targets support the API". |
Let's step back. What exactly is being asked here?
These are related but not the same thing. Either way, my question is why you want this to happen. If you don't want to target .NET Standard, then don't. But I don't understand what is gained by advocating for this repo/.NET all up to remove it. It's mostly a giant breaking change. To put things in perspective: 1/3 of all packages on nuget.org target .NET Standard. When you remove .NET Standard from your package, it has ripple effects for everyone depending on it (if they target .NET Standard). |
I want only the second, and 1/3 of the packages you mentioned are for netstandard, How much of this 1/3 is just a single target framework? Perhaps most packages are multi target framework. The current netstandard is merely a collection of target frameworks that are no longer supported. For a better future, I believe we should drop support for it. |
@Varorbc many netstandard libraries on NuGet, especially those that depend on other netstandard libraries, would be left without support if netstandard is abandoned. Additionally, having multiple framework assemblies in a NuGet package, as opposed to a single assembly, is one of the practical reasons for maintaining netstandard. reducing reliance on netstandard by migrating existing .NET Framework projects to newer frameworks, particularly those challenging transitions like Windows Forms to Razor views, is a constructive path forward. This could gradually decrease the relevance of netstandard over time. |
I don't know how many of them target multiple framework, but my gut feel is many, at least half of those, if not more. But keep in mind that NuGet is the "leaf" node in this; there are a ton of libraries that exist in application projects to share code between, say, a .NET Framework desktop app and an ASP.NET Core backend. I have quite a few of those. And there I mostly get away with not having to multi-target. Even if the entire NuGet ecosystem were to multi-target you'd still break this scenario. My view is: as long as .NET Framework is still relevant, people will want a way to build a single framework project that they can use to share code with .NET Core. |
This is precisely our case. We have tons of libraries targeting NET Standard 2.0 on a 150-project solution comprising of various types of Web APIs, Windows Services and Console Application type projects, most of which we intend to migrate to .NET8, but some of which can't be migrated, as they currently use WebForms. We envision we'll have at least some NET Standard 2.0 libraries for a good while even after performing this NET8 (or NET9) migration. |
A few years ago, when netstandard still had target frameworks that were supported, it wouldn’t have made sense to drop it. But now, with .NET 10 coming up, we really should consider this. We’ve given plenty of time for the move from .NET Framework to .NET Core, and we can’t keep supporting it forever. If .NET 10 doesn’t drop support, we should definitely think about doing it later. |
What are you talking about @Varorbc . I'll repeat: WebForms is still supported and it is limited to .NET Framework 4.8. Microsoft can't just stop supporting .NET Framework, unless they make something like CoreWebForms official and fully featured. And that's just one of the things that are tied to NET Framework. I don't disagree with you conceptually, that we should unify on newer .NET framework versions, but I don't think that is doable today. |
I would rather see that .NET Framework 4.6.x would be removed than .NET Standard 2.0. From my understanding .NET Framework is only added because .NET Framework 4.6.x had issues with .NET Standard:
But .NET Framework 4.6.2 is supported until Jan 12, 2027 so that won't happen anywhere soon 😅 |
You're conflating a few things here:
Hence saying that .NET Standard is pointless is missing the mark. |
It solved my problem, but with libraries like SqlClient dropping support for netstandard, it’s only a matter of time before the runtime does the same. I’m not sure when that day will come. |
I can assure you that @terrajobst will be (very) well-informed on that day coming (AKA, he'll be the one driving it). Clearly, that day has not come. |
In fact, the library for the author, is also a very painful thing |
How about… /runs and hides *pick some other name, maybe even corresponding to real .Net releases. Big trade off investing more here, but the longer we leave it yes more will have jumped across the widening chasm from fx to core, but also more will be stranded… on the framework side. |
The effort of creating a new target framework is quite large. It doesn't provide enough benefit. This is definitely not an option. |
More APIs existing in modern .NET does not equate to an increase in complexity of users moving off of .NET Framework. The porting effort remains overall the same and the typical scenario is rather that we've made it even simpler to migrate because more APIs that were missing have been added instead. -- This is why it's often considered easier to migrate from .NET Framework to .NET 5+ than it was to migrate to .NET Core 1.0, 2.1, or 3.1; because there was a larger surface area parity between them. The experience today ends up being that most APIs from the BCL exist and remain backwards compatible. There are some that have had behavioral changes and bug fixes that may need to be accounted for, which were generally done to better support cross platform semantics or to fix historically incorrect behavior that couldn't easily be fixed in .NET Framework (but which fixing allowed apps to be more correct, more robust, and often faster as well). There are also higher level frameworks, like ASP.NET Core, which were complete rewrites and which have their own compat/porting considerations. There are some technologies that never made it over to modern .NET, often because they were fundamentally broken in some way and were already considered largely legacy, deprecated, or broken. These can be the largest hurdles for porting, but often have alternatives. https://learn.microsoft.com/en-us/dotnet/core/porting/ covers much of these differences and the tooling that can help in migrating. Introducing a newer standard won't move the needle here at all. |
That would probably not be possible because it likely violates framework compat rules. Since we already shipped a .NET Standard 2.1 we can't ship a .NET Standard 2.0.X that has more APIs than .NET Standard 2.1. We could, however, in principle at least, try to find the set of APIs that are in .NET Standard 2.1 and .NET Framework and ship a 2.0.1 but I don't see compelling enough evidence for that. |
The text was updated successfully, but these errors were encountered: