Even if you have been working with .NET for some time it can be hard to know the differences between the .NET Framework, .NET Core, and Mono. And what is this .NET Standard thing?
In this post I will describe the different architectural components of .NET and hopefully make all of this a bit clearer.
Implementations of .NET
Try to imagine that you are just starting out with .NET development. You open up Visual Studio for the first time ever to create a new C# project, and you are faced with this:
How on earth are you supposed to know what to choose? Even if you might figure out that it probably is easiest to start with a Console App, you still need to know whether you should choose the one ending with (.NET Core) or the one ending with (.NET Framework).
Let’s start by explaining the different implementations of .NET.
This is the original .NET implementation that has existed since 2002 (announced 2000). It supports all the standard framework functionality, APIs, and a number of Windows-specific APIs. It is optimized for building Windows desktop applications, and is pretty much the only option if you are planning on building a graphical .NET application for the Windows desktop.
This is a newer implementation of .NET, version 1.0 was released in 2016. It is cross platform, i.e. it runs on Windows, macOS, and Linux. It supports the standard framework functionality but contains no support for building graphical user interfaces (this might change, for applications targeting Windows, in version 3.0, planned to be released sometime during 2019).
It is recommended to choose .NET Core for new desktop and server projects that does not require the Windows specific features that is part of the original .NET Framework.
The Mono implementation of the .NET framework is mainly targeting systems where a small runtime is needed, such as Android and iOS. But also games built with Unity and the new web framework Blazor, uses Mono. It supports the standard framework functionality as well as everything in .NET Framework 4.7 except Windows Presentation Foundation (WPF), Windows Workflow Foundation (WWF), limited Windows Communication Foundation (WCF) and limited ASP.NET async stack.
If you are targeting mobile, Unity, or Blazor, then you should read up on Mono.
Universal Windows Platform (UWP)
This implementation of .NET is intended for targeting touch-enabled Windows devices such as tablets and phones, and also the XBOX One. It supports the standard framework functionality as well as many services such as a centralized app store, an execution environment, and alternative Windows APIs.
While explaining the different implementations of .NET above I wrote that they ”support the standard framework functionality”. But what is that?
There is some confusion around .NET Standard and how it fits into the .NET ecosystem. Let’s clear it out. .NET Standard is a set of APIs that is common to all implementations of .NET.
In other words, .NET Framework implements .NET Standard, and so does .NET Core and Mono. This means that if you create a library that targets .NET Standard, it will be compatible with all implementations of .NET.
I will not be able to list the APIs in .NET Standard. The current version, 2.0, includes more than 32 000 APIs. You can however find the complete listing here.
Components of a .NET implementation
Now that we know how different implementations of .NET have different use cases, and that they implement a set of standard APIs, we can take a look at what makes up an implementation of .NET. As part of the implementation you can expect to find:
- One or more runtimes, such as the Common Language Runtime (CLR) for the .NET Framework, and CoreCLR for .NET Core
- A library that implements the .NET Standard APIs, such as the Base Class Library (BCL) for the .NET Framework and .NET Core
There are also some optional components such as:
- WPF and WCF for the .NET Framework
- Different compilers
- Tools for organizing your code into projects and projects into solutions
- Tools for handling and organizing external libraries, for example nuget
As we have seen there are several different implementations of .NET. However, they all have slightly different use cases, even though there is some overlapping. When you have finished reading through this post you hopefully have a good enough understanding on the differences to know which implementation that is suitable for your use case.