The last few years in the .NET ecosystem has been a confusing one. With the release of .NET Core and ASP.NET Core, a lot of people aren’t sure what these are and how they relate to the already existing .NET and ASP.NET platforms.
I’ve also found that a lot of the existing explanations out there are very in-depth and detailed, so it can be tough to pull out the highlights for people who don’t care much about the framework internals. I’ll take a high-level approach on .NET Core here to get you started, and focus on ASP.NET Core in a future post.
The .NET Framework
In the beginning, there was the .NET framework. To understand what .NET Core is, we need to briefly go back a bit. The .NET Framework was originally a single stack designed to build Windows applications and web applications that would run on Windows Server. Over time, more forks were done to create stacks for other environments, such as Windows Phone and Xamarin (iOS, Android).
Eventually this lead to a series of problems (exhaustively detailed here by Immo Landwerth of Microsoft) that required a rethinking of the approach moving forward.
Enter .NET Core
The end result of this rethinking was .NET Core, a new framework that is separate from the existing .NET Framework. This new framework has a few key differences, starting with the fact that it’s completely open source and on Github here: https://github.com/dotnet/core
One key thing to note is that .NET Core does not support all of the application types that the .NET Framework does.
- Supported: Web apps with ASP.NET Core, console apps, class libraries, Windows 10 Universal Windows Platform (UWP), unit test projects
- NOT Supported: Windows Services, WPF, Windows Forms
This slide from Scott Hunter at Build 2016 is a useful diagram:
It’s Cross Platform
.NET Core is fully cross platform and runs equally well on Windows, Linux, and Mac OSX. You can now run (and even develop!) apps built with .NET Core on Linux or Mac OSX, which brings a whole new set of options to the .NET ecosystem that previously didn’t exist.
New Command Line Tools
.NET Core comes with a new command-line interface (CLI) that is cross-platform. This means you can easily create new projects, run tests, restore nuget packages, run builds, and much more all from the command line. A major implication of this is that higher-level tooling (such as editors and IDEs) can be built on top of these CLI commands. The .NET ecosystem is already seeing the benefits with the release of Visual Studio Code, a cross-platform lightweight code editor for .NET Core applications (with support for many other languages & platforms as well). This was a major step in making it not only possible, but easy and practical for developers to build .NET apps on Linux and Mac development machines.
No More Machine-Wide Installation
The .NET Framework is a machine-wide framework, meaning that it gets installed on the machine and any changes to it affect every application installed on that machine. That has some benefits, but also some downsides in the modern development environment. .NET Core improves on this by being deployed as part of your application itself, as a set of NuGet package dependencies. Now, upgrading your .NET Core version just means upgrading the appropriate NuGet packages, which will get deployed without any changes/installations required on the server or app host.
If this high-level overview wasn’t enough and you’d like more details, check out these great in-depth posts: