Will there be any need for .NET Standard after release of .NET 5.0

Since .NET 5.0 will unify the .NET and .NET Core platforms, will there be any need to build .NET Standard class library type projects to target different versions of .NET and .NET Core?

1 answer

  • answered 2020-10-16 05:12 Egor Popov

    There is the good article on devblogs by Immo Landwerth:

    as for your question:

    .NET 5 and all future versions will always support .NET Standard 2.1 and earlier. The only reason to retarget from .NET Standard to .NET 5 is to gain access to more runtime features, language features, or APIs. So, you can think of .NET 5 as .NET Standard vNext.

    • Use netstandard2.0 to share code between .NET Framework and all other platforms.
    • Use netstandard2.1 to share code between Mono, Xamarin, and .NET Core 3.x.
    • Use net5.0 for code sharing moving forward.

    summary:

    net5.0 is for code that runs everywhere. It combines and replaces the netcoreapp and netstandard names. We also have platform-specific frameworks, such as net5.0-windows (and later also net6.0-android, and net6.0-ios).

    Since there is no difference between the standard and its implementation, you’ll be able to take advantage of new features much quicker than with .NET Standard. And due to the naming convention, you’ll be able to easily tell who can consume a given library — without having to consult the .NET Standard version table.

    While .NET Standard 2.1 will be the last version of .NET Standard, .NET 5 and all future versions will continue to support .NET Standard 2.1 and earlier. You should think of net5.0 (and future versions) as the foundation for sharing code moving forward.