When I think of .NET, I think of the .NET Framework and Visual Studio. The first production version 1.0 of the .NET Framework was released on February 13 in 2002. In technology years, this is light-years ago.
Since then, new versions of the .NET Framework have been released and Microsoft has started efforts to keep .NET a viable development platform in the modern era of the web, mobile and the cloud. This has resulted in the recent release of .NET Core 2 and .NET Standard 2.0. Because of this evolution, the .NET ecosystem has become large and sometimes confusing.
Before you start your next project, you will want to understand your best options. We’ll try to address some of the confusing components to help you work more efficiently.
.NET Ecosystem confusion
We all know about the .NET Framework, but how does that work with the Base Class Library? And what are Portable Class Libraries and when should you use those? And now there is .NET Core. What is that, and how is it different from the .NET Framework? And what is the Roslyn Compiler and should you care? And finally, what is .NET Standard, and is it part of .NET Core? Is it something that you can install? What should you use to build a reusable library?
All of this results in confusion and difficulty when you are trying to pick the right project type for your requirements. There are so many options. A .NET Standard class library, a .NET Core one or a .NET Framework one. And what is the Shared Project and this Portable Class Library?
Where should you focus your efforts? Should you learn everything about .NET Core and abandon older knowledge? Which type of runtime should you use? These are very important questions to answer before you start your next project or start learning about a new technology. We’ll try to answer them in this article.
The .NET ecosystem explained
The .NET ecosystem is being revamped to fulfill the requirements of modern applications. The overview that follows, represents the current state of the ecosystem.
The .NET Framework
The .NET ecosystem has runtimes. The oldest and most well-known runtime is the .NET Framework. Here is where the confusion begins: even though it is called the .NET Framework, it is mainly a runtime. It does have a framework in it and it is also a platform, and so do all the other runtimes, but we’ll get to that in this article. Note that I am using the definitions that Microsoft uses, so that this all makes sense when you read the documentation.
As I stated earlier, the .NET Framework exists since 2002 and is still going strong. You can build WPF, Windows Forms and ASP.NET Forms and MVC applications with it.
You can build more application types with the .NET Framework, but the types are mainly Windows-centric. This is because the .NET Framework uses some Windows-specific API’s for some application types.
Then there is the .NET Core runtime. .NET Core was released in 2016 and can be used to create ASP.NET Core and Universal Windows Platform (UWP) applications with. It runs cross-platform and can be installed side-by-side, meaning that you can have many versions of .NET Core running on the same computer. It is also small and optimized for performance.
.NET Core is not the new version of the .NET Framework, it is just a different version that you can use for some use cases. .NET Core is not going to replace the .NET Framework.
Mono for Xamarin
Finally, there is the Mono runtime, which is used by Xamarin applications. The Mono runtime itself is a cross-platform implementation of the .NET Framework and it can run all sorts of applications, like console and Windows Forms applications. Because this article focuses on the .NET Ecosystem, I will limit the discussion around Mono to Xamarin.
Xamarin has been around since about 2011 and you can use it to create applications for iOS, for macOS and Android. This is used to build and run native or near-native mobile applications across mobile platforms. The Mono runtime with Xamarin uses specific API’s for iOS and Android and for building Xamarin.Mac applications.
The three runtimes all implement .NET Standard. .NET Standard is a specification of .NET APIs that have implementations for each .NET runtime. Because of this, code created for one runtime, can also be executed by another runtime. You can find out more about .NET Standard in this article.
Tools and Infrastructure
Finally, all the runtimes use tools and infrastructure to compile and run code. This includes languages, like C#, VB.NET and F#, which, for the most part, can run on all the runtimes. This also includes build tools, like MSBuild and things like the Common Language Runtime (CLR) and the CoreCLR.
Comparison of the Runtimes
Let’s compare the three different runtimes. They all run different application workloads. They have different ways of being installed on computers and they all have different purposes. This table summarizes these differences:
|.NET Framework||.NET Core||Mono for Xamarin|
|Workloads||WPF, Windows Forms, ASP.NET||ASP.NET Core, UWP||iOS, macOS, Android|
|Side-by-side||Only major versions||X||X|
|Main purpose||Windows desktop apps||Cross-platform web and desktop apps||Cross-platform mobile apps|
The .NET Framework, .NET Core, and Mono are runtimes. These runtimes also contain frameworks for building applications and libraries.
The .NET Standard Library is a set of API specifications. It is not a thing that you download and install, it is a specification that describes API’s and what they do.
And finally, the common infrastructure is the stuff that makes all of this work. It contains compilers, languages and runtime components, like the garbage collector and just in-time compilation.
This seems complex at first, but when you break it down like this, it makes sense and shows how Microsoft is able to revamp the ecosystem and keep it alive and vital.
This article has just been a brief overview of the .NET Ecosystem. If you want to dive deeper, please watch my 1.5 hour Pluralsight course: The .NET Ecosystem: The Big Picture.
Let me know what you think in the comments.
- Testing in Production with Microsoft Azure - March 1, 2018
- How to DevOps with Azure - February 28, 2018
- Compare Azure SQL Database vs. Azure SQL Data Warehouse: Definitions, Differences and When to Use - February 14, 2018
- .NET Standard Explained: How To Share Code - January 23, 2018
- How to Build Cross-Platform .NET Core Apps - January 15, 2018