You'll often hear the terms
platform used interchangeably. This can be very confusing. You'll hear that .NET Core is a platform. Then you'll read that .NET Core is cross-platform. Next, you'll learn that .NET Core is a framework. And it doesn't help that framework is part of the name of the original full .NET Framework.
In this post, I explain the difference between frameworks and platforms and explain why sometimes you'll see .NET being referred to as a framework and other times see it referred to as a platform.
To simplify things, I will define platform and framework based on Alex's definition as follows:
- Platform - hardware / architecture (x86 vs x64) / operating system
- Framework - software / libraries / scaffolding
Using these definitions, ASP.NET Core is a framework as it provides libraries and scaffolding for building web applications in a particular way, whereas Windows x86 and Linux x64 are platforms.
.NET Core and .NET Framework may seem like frameworks as they're software and consist of libraries of code and scaffolding for different types of application. However, in practice, the difference is much more subtle, complicated, and technical and you'll see why both terms are used interchangeably to refer to .NET Core and .NET Framework.
Libraries, Runtimes, and Compilers
When your application targets .NET Core, it doesn't just use the
System.* libraries (mscorlib) with which you're familiar. It also runs on the .NET Core runtime (CoreCLR), which includes components like the object allocator, garbage collector, and more. Furthermore, it relies on RyuJIT, which is the Just In Time compiler that transforms bytecode (CIL / MSIL) into native executable code.
Viewed at this lower level, when an application targets .NET Core, it's not only choosing the libraries (or framework), but also the runtime and compiler as well. In that sense, .NET Core is more like the operating system and therefore, we should call it a platform using the earlier definition.
Usage of Terminology
You'll often find the word framework is used when the focus is on the library aspect and that the word platform is used when the focus is on the runtime and compiler aspect. When the focus is on both aspects, either term might be used.
This terminology is used in the same way whether you are talking about .NET Core, .NET Framework, Mono, or Xamarin, but is inappropriate to use with .NET Standard, which is something different altogether.
.NET Core, .NET Framework, Mono, and Xamarin are all both platforms and frameworks. The platform part refers to the runtime and compiler, while the framework part refers to the code library.
.NET Standard is completely different. In my next blog post, I'll explain .NET Standard.
Update (19th August 2017): Scott Hanselman pointed out that ASP.NET Core is the correct name for the latest web framework. This post originally referred to it as ASP.NET Core MVC.