What is .NET Core and how is it different from .NET Framework?
Beginner
dot NET Core is a free, open source, and cross platform framework built by Microsoft for building modern applications that can run on Windows, Linux, and macOS. The older dot NET Framework, in comparison, only runs on Windows and is closed source. dot NET Core is also modular, meaning you only include the packages your application actually needs, which makes it faster, lighter, and better suited for cloud native and containerized applications compared to the monolithic dot NET Framework.
// A dot NET Core console app runs the same way on any OS
dotnet new console -o MyApp
dotnet run --project MyApp
Real-world example
A company running its web API on Windows Server with dot NET Framework migrates to dot NET Core so the same application can also run inside Linux based Docker containers in the cloud, reducing hosting costs significantly.
Common follow-ups: Is dot NET Framework still supported by Microsoft?;What replaced dot NET Core going forward?
What are the main differences between .NET Core and .NET 5/6/7/8?;Redis with Docker & Kubernetes
What are the main differences between .NET Core and .NET 5/6/7/8?
Intermediate
Starting with dot NET 5, Microsoft unified dot NET Core, dot NET Framework, and Xamarin into a single platform simply called dot NET, dropping the word Core from the name. dot NET 5 and later versions continue the cross platform, high performance, open source foundation that dot NET Core established, while adding new language features, performance improvements, and support for more application types such as mobile and machine learning workloads within one consistent SDK and runtime.
// Checking the installed SDK version
dotnet --version
// Targeting net8.0 in a project file
<TargetFramework>net8.0</TargetFramework>
Real-world example
A development team upgrades an older dot NET Core 3.1 web application to dot NET 8 to take advantage of long term support, faster performance, and newer C# language features, without having to change their overall project structure.
Common follow-ups: Which dot NET versions receive long term support from Microsoft?;Can a dot NET Core 3.1 project be upgraded directly to dot NET 8?
.NET Core Overview & Versions;What is .NET Core and how is it different from .NET Framework?