BT

Your opinion matters! Please fill in the InfoQ Survey!

.NET Core and .NET Standard: What Is the Difference?

| by Michael Stiefel Follow 0 Followers on Oct 09, 2017. Estimated reading time: 3 minutes |

A note to our readers: As per your request we have developed a set of features that allow you to reduce the noise, while not losing sight of anything that is important. Get email and web notifications by choosing the topics you are interested in.

Microsoft has just announced .NET Core 2.0, but confusion still exists among developers as to the differences between .NET Core, .NET Standard, Xamarin, and the .NET Framework

The .NET Framework is used for building desktop applications and ASP.NET applications running on Internet Information Server (IIS). It was the first managed framework released.

Xamarin is a managed framework used for building iOS, Android, and macOS desktop applications.

.NET Core

.NET Core is a free, cross-platform, open source implementation of the managed framework. It supports four types of applications: console, ASP.NET Core, cloud, and Universal Windows Platform (UWP). Windows Forms and Windows Presentation Foundation(WPF) are not part of .NET Core.

Technically, .NET Core only supports console applications. ASP.NET Core and UWP are application models built on top of .NET Core.

Unlike the .NET Framework, .NET Core is not considered a Windows component. Therefore, updates come as NuGet packages, not through Windows Update. Since the .NET Core runtime is installed App-Local, and applications are updated through the package manager, applications can be associated with a particular .NET Core version and be updated individually.

.NET Standard

Each implementation of the managed framework has its own set of Base Class Libraries. The Base Class Library (BCL) contains classes such as exception handling, strings, XML, I/O, networking, and collections.

.NET Standard is a specification for implementing the BCL. Since a .NET implementation is required to follow this standard, application developers will not have to worry about different versions of the BCL for each managed framework implementation.

Framework Class Libraries (FCL) such as WPF, WCF, and ASP.NET are not part of the BCL, and therefore are not included in .NET Standard.

The relationship between .NET Standard and a .NET implementation is the same as between the HTML specification and a browser. The second is an implementation of the first.

Hence, the .NET Framework, Xamarin, and .NET Core each implement .NET Standard for the BCL in their managed framework. Since the computer industry will continue to introduce new hardware and operating systems, there will be new managed frameworks for .NET. This standard allows application developers to know that there will be a consistent set of APIs that they can rely on.

Each .NET version has an associated version of the .NET Standard.

By providing consistent APIs, porting applications to different managed implementations, as well as providing tooling, is easier.

.NET Standard is defined as a single NuGet package because all .NET implementations are required to support it. Tooling becomes easier because the tools have a consistent set of APIs to use for a given version. You can also build a single library project for multiple .NET implementations.

You can also build .NET Standard wrappers for platform specific APIs.

.NET Standard vs Portable Class Libraries

Did not Portable Class Libraries do the same thing?

Portable Class used a union of the common APIs that a platform supported. Hence, the more platforms you supported, the fewer APIs available. It was then difficult to understand what APIs were actually supported for a given combination of platforms. With a new platform, the existing PCLs would have to be recompiled. PCLs also required Microsoft to create a new Framework implementation fork for each platform.

Since .NET Standard fixes the API, rather than an implementation, there is no need to recompile an application. Any new .NET implementation that gets released implements the required libraries. An application can target the new hardware platform or operating systems without any need to recompile.Theoretically, you could get a NotSupportedException from invoking an API, but that should be rare.

Conclusions

.NET Standard is an API specification that defines, for a given version, what Base Class Libraries must be implemented.

.NET Core is a managed framework that is optimized for building console, cloud, ASP.NET Core, and UWP applications. It provides an implementation of .NET Standard for the Base Class Libraries.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Best explanation so far by Chet Potvin

I think @davidfowl explained it best in his psuedocode:

gist.github.com/davidfowl/8939f305567e1755412d6...

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT