Motivation
I have been learning ASP.NET Core for some time now. During the process, I struggled to differentiate between .NET Core and .NET Framework. To help beginners from the struggle of understanding what .NET Core is and how it is different from .NET framework, I wrote this article.
What is .NET Core?
.NET Core is a cross-platform (supports Windows, macOS, and Linux), open-source and general-purpose application development platform. The platform is being maintained by Microsoft and the .NET community in GitHub. According to the MSDN, it can be used to create console applications, modern web applications, microservices and libraries.
What is .NET Framework?
.NET Framework is a platform for building apps for web, Windows, Windows Phone, Windows Server, and Microsoft Azure. It is developed by Microsoft and primarily runs on Microsoft Windows. The components of .NET framework include the common language runtime (CLR) and the .NET class library.
The Architectural Components of .NET Core
One of the key characteristics of .NET core is modularization. This means that it is made up of a set of modular components. The main components of .NET Core are:
1. .NET Core Runtime
This is a software environment that provides services such as security, memory management, and exception handling for .NET Core applications. It is responsible for loading and executing .NET assemblies, which are the compiled output of .NET core programs.
2. Collection of SDK tools and compilers
This collection of tools and compilers enables developers to create, build, run, and test .NET Core applications. It includes a command-line interface (CLI) for the .NET Core SDK, as well as compilers for C# and Visual Basic.
3. Collection of Framework libraries
Framework libraries provide the fundamental building blocks for developing .NET applications. They include primitive data types, utility classes, and other essential functionality.
Getting Started with .NET Core
.NET core is distributed in two different ways to accommodate different use cases and deployment scenarios:
NuGet Package:
.NET Core can be distributed as a NuGet package. NuGet is a package manager for .NET that allows developers to easily download and manage libraries and frameworks. When .NET Core is distributed as a NuGet package, it means that you can include it as a dependency in your project just like any other library. This method is often used when you want to build and develop applications that target .NET Core. You can specify the version of .NET Core you want to use in your project, and the NuGet package manager will handle downloading and managing the appropriate version of .NET Core for your application.
Downloading and Installing .NET via NuGet Package (as of .NET 5 or later)
If you're using Visual Studio, make sure it is installed and updated to the latest version. If you're not using Visual Studio, you can still download .NET SDK using the command line as shown in the following steps:
- Open a Terminal (Linux/ MacOS) or Command Prompt (Windows)
Check for Existing .NET SDK using the below command. If you see a version number, that means the .NET SDK is already installed. If not, you'll need to download it.
dotnet --versionDownload and Install the .NET SDK. To do this first check the list of .NET SDKs that are available for download using:
dotnet --list-sdksChoose the version that you want to install and install it using:
dotnet install --version 6.0
Finally, verify the installation using:
dotnet --version
Standalone distribution
This means that you can download a complete and self-contained installation of .NET Core, separate from any specific project or application. This standalone distribution includes the runtime, libraries, and development tools. Standalone distributions are often used in scenarios where you need to run or host .NET Core applications without integrating .NET Core into a specific project. For example, you might install a standalone distribution of .NET Core on a server to run multiple .NET Core applications independently. To install the .NET Core standalone distribution on Windows, Linux, and macOS, follow these steps:
Windows
- Download the .NET Core standalone distribution from the Microsoft website: https://www.microsoft.com/net/download.
- Double-click on the downloaded file to start the installation process.
- Follow the prompts on the screen to complete the installation.
Linux
- Open a terminal window.
- Download the .NET Core standalone distribution from the Microsoft website: https://www.microsoft.com/net/download.
- Extract the contents of the downloaded archive to a directory on your machine.
- Open a terminal window and navigate to the directory where you extracted the .NET Core standalone distribution.
Run the following command to install the .NET Core standalone distribution:
./dotnet-install.shEnter your password when prompted.
MacOS
- Open a terminal window.
- Download the .NET Core standalone distribution from the Microsoft website: https://www.microsoft.com/net/download.
- Extract the contents of the downloaded archive to a directory on your machine.
- Open a terminal window and navigate to the directory where you extracted the .NET Core standalone distribution.
Run the following command to install the .NET Core standalone distribution:
./dotnet-install.ps1Enter your password when prompted.
Once the installation is complete, you can verify that the .NET Core standalone distribution is installed correctly by running the following command:
dotnet --version
Differences between .NET Framework and .NET Core Framework
The key differences between .NET framework and .NET Core are:
- Open-source-The entire .NET Core Framework is made open-source (using MIT and APache 2 licenses) while only a portion of .NET Framework is open-source such as the Entity Framework.
- Cross-platform- Unlike .NET Framework which only runs on Windows operating system, .NET Core runs on Windows, macOS and Linux operating systems.
- Components/ Subsystems- Certain aspects of the .NET Framework, like code access security, are not available in .NET Core because of its more streamlined programming model.
- API Support- Not all APIs available in .NET Framework are supported by .NET Core.
Top comments (0)