In this article, we will learn about an introduction to .NET Core Framework i.e. what is NET Core & its characteristics, what it is used for, why it was written from scratch, which type of applications we can build using .NET Core, the history of the .NET Core, different versions of .NET Core available & supported and much more.
This is the second post in the series – Getting Started with .NET Platform, .NET Framework & .NET Core (.NET 5+)
- Post 1 – Introduction to .NET Framework
- Post 2 – Introduction to .NET Core (.NET 5+) (this post)
- Post 3 – .NET Framework vs .NET Core (.NET 5+)
- Post 4 – Migrate from .NET Framework to .NET Core (.NET 6) – Detailed Guide
Table of Contents
.NET Core Overview
.NET Core now known as .NET is a free, open-source, cross-platform development platform created and maintained by Microsoft for building various types of applications for the users. .NET Core platform is also being maintained by the .NET community on GitHub along with Microsoft.
.NET Core has been developed from scratch to make it a lightweight, cross-platform, modular and fast Framework. To reduce the memory footprint of applications in .NET Core by default the application contains only the core features to run the application and other features are optional/additional which you can add based on your requirements.
.NET Core was developed to overcome the limitation of the .NET framework of being able to run only on Windows. The .NET Core also supports more variety of applications targeting different platforms as compared to the .NET Framework.
When you develop applications with .NET Core then no matter which type of application you are building your code and project files will feel the same. The runtime, base API and language capabilities are also the same irrespective of the type of application being developed.
.NET Core is supported by Microsoft on Windows, macOS & Linux. Microsoft provides regular updates for security and quality. Microsft makes use of Self-maintained azure servers to test new releases of .NET Core
.NET Core Characteristics
.NET Core was written from scratch mainly to provide the following characteristics to the developers
Open Source – The .NET Core Framework is open source using MIT & Apache 2 License. The .NET Core is a project of the .NET Foundation. Here is the complete list of .NET repositories on GitHub.
Cross-Platform – The .NET Core can be used to create applications for many platforms such as Windows, macOS, Linux, Android, iOS, tvOS and watchOS. The .NET Core also allows you to use platform-specific APIs of the operating system.
Flexible Deployment Models – .NET Core applications can be deployed as either self-contained apps that include both the .NET Core runtime and libraries or as framework-dependent apps that require the .NET runtime and libraries to be installed on the user machine. The .NET Core applications can also be installed using Docker containers.
Consistent across Processor Architectures – The .NET Core runs your applications with the same behaviour on multiple processor architectures including x64, x86, ARM32 and ARM64.
Modular Architecture – The .NET Core is divided into modular components known as NuGet packages. These NuGet packages are separated as per the functionality provided by them. You can only include the required NuGet packages as per your requirements and functionality provided by your application. Even the .NET Core library is provided as NuGet packages as this allows you to choose components instead of including the entire .NET Core Framework
Compatibility – As .NET Standard is the base library for .NET Implementations .NET Core is also compatible with .NET Framework, Xamarin and Mono via .NET Standard.
Release History of .NET Core
As of now only .NET 6, 5 and .NET Core 3.1 are supported versions of .NET Core and the rest of the prior versions has crossed the End Support date.
Version | Release Date | Visual Studio | End of Support |
.NET 6 | November 8, 2021 | Visual Studio 2022 | November 8, 2024 |
.NET 5 | November 10, 2020 | Visual Studio 2019 | May 8, 2022 |
.NET Core 3.1 | December 3, 2019 | Visual Studio 2019 | December 3, 2022 |
.NET Core 3.0 | September 23, 2019 | Visual Studio 2019 | March 3, 2020 |
.NET Core 2.2 | December 4, 2018 | Visual Studio 2019 | December 23, 2019 |
.NET Core 2.1 | May 30, 2018 | Visual Studio 2019 | August 21, 2021 |
.NET Core 2.0 | August 14, 2017 | Visual Studio 2017-19 | October 1, 2018 |
.NET Core 1.1 | November 16, 2016 | Visual Studio 2015 | June 27, 2019 |
.NET Core 1.0 | June 27, 2016 | Visual Studio 2015 | June 27, 2019 |
Applications that are targeting out of support .NET Core versions should be ported to a newer version of .NET Core i.e. .NET 6.
.NET Core Components
.NET Core provides SDK & runtimes to be downloaded & installed to run .NET Core based applications. The .NET Core SDK is more for the developers that contain libraries & tools for developing and running .NET Core applications. The .NET Core runtime is just the execution environment for running .NET Core based applications.
The .NET Core SDK consists of the following components
The .NET CLI is the command-line interface tool for the development, testing, & deployment of .NET Core based applications.
The dotnet driver is the CLI command (dotnet.exe) that is responsible for executing commands that are provided to it and running framework-dependent applications. You can pass commands to the dotnet driver as shown below
dotnet build
dotnet new console
dotnet --help
Roslyn is the programming language compiler
The MSBuild is the build engine used to build .NET Core based applications
The .NET runtime (CLR & JIT) provides the execution environment services to .NET Core based applications.
The Runtime Libraries provides the type system and a vast set of APIs and types for the development and implementation of the common functionality in your application
Programming Languages Supported in .NET Core
.NET Core also comes with a choice of language that can be used by developers for coding and majorly supports 3 main programming languages. So developers can choose and code in their preferred choice of language.
C# – Pronounced as C Sharp is the most popular programming language on the .NET platform. It is a simple yet powerful, modern, objected-oriented and type-safe programming language available on the .NET Core platform.
F# – Pronounced as F Sharp allows developers to easily write programs that are clearly expressed, robust and performant. The functional, object-oriented and imperative programming models are supported by F#.
Visual Basic – It is an object-oriented and type-safe language that is easy to read, write and understand as it is the closest to ordinary human language. Visual Basic is stable and not being added with new features actively. Visual Basic isn’t supported for web applications in .NET Core but it is supported for web APIs.
.NET Core applications are written in C#, F#, or Visual Basic and compiled to Common Intermediate Language (CIL).
Application Types Supported in .NET Core
You can use .NET Core to develop the following types of applications and services
- Web Applications
- Web API and Microservices
- Serverless Functions for Cloud
- Cloud Native Applications
- Mobile Applications
- Desktop Applications – Console Applications, Windows WPF & Windows Forms
- Gaming Applications
- Internet of Things (IoT) Applications
- Machine Learning
- Windows Services
- Class Library
.NET Core IDE
.NET Core also provides options for the integrated development environment (IDE) that can be used by developers and IDE for .NET Core includes the following options
Visual Studio IDE (integrated development environment) can be used for the development of applications using the .NET Core. This is a windows only IDE and provides extensive functionality for development, executing and testing your applications. There are different editions of Visual Studio provided by Microsoft and there is also a community edition that is free for students, open-source contributors, and individuals.
Visual Studio Code is a code editor provided by Microsoft that can run on Windows, macOS & Linux. There are extensions available for Visual Studio Code for working with .NET Core applications.
Visual Studio for Mac IDE can be used on macOS only. This can be used to develop .NET Core apps and games for iOS, Android & Web.
GitHub Codespaces is an online Visual Studio Code environment
.NET Core Deployment Models
.NET Core provides 2 different models for publishing .NET Core applications
Self-Contained – In this model, .NET Core application binaries and all of its dependencies including third-party libraries, .NET Core runtime and libraries get deployed along with it. So there is no need for users to install any other runtime of software just install the self-contained .NET Core app to use the application on that machine. Self-contained .NET Core applications are platform-specific.
Framework-Dependent – In this model just .NET Core application binaries get deployed along with the application and to execute this application users need to separately install the third-party dependencies if any, .NET runtime and libraries. In this model the executables are platform-specific but the assemblies .dll files are cross-platform. Users can install multiple versions of .NET Core runtime side by side to run .NET Core applications targeting different versions of the runtime.
.NET Core Execution Models
In a similar way to .NET Framework, the .NET Core Applications as well run managed code in a runtime environment known as Common Language Runtime (CLR). But .NET Core CLR is a cross-platform compliant runtime that includes support for Windows, macOS & Linux. CLR also handles memory allocation & management for .NET Core applications by using a garbage collector (GC). GC manages the allocation and release of memory for applications. .NET Core CLR also makes use of a Just-in-time (JIT) compiler to convert Intermediate Language (IL) to machine code that is understood by the processor for the execution of the code.
.NET Core also offers ahead-of-time (AOT) compilations option. The default option for most .NET Core applications is JIT compiler but some conditions require either 100% AOT like in iOS or a combination of JIT & AOT i.e. most code is AOT compiled but some are JIT-compiled.
Summary
The .NET Core is a better Framework as compared to its predecessor .NET Framework. It has been developed from scratch to provide improvements like lightweight, cross-platform, open-source, modular, & better performance.
.NET Core i.e. .NET 5+ looks future-ready to take on the challenges from modern world cloud-based applications.
Hope you enjoyed reading this article. Please provide your suggestions & questions in the comments section below
References – Introduction to .NET Core
You can also check my other trending articles on .NET Core to learn more about .NET Core Applications
- Microservices with ASP.NET Core 3.1 – Ultimate Detailed Guide
- Entity Framework Core in ASP.NET Core 3.1 – Getting Started
- Series: ASP.NET Core Security – Ultimate Guide
- ML.NET – Machine Learning with .NET Core – Beginner’s Guide
- Real-time Web Applications with SignalR in ASP.NET Core 3.1
- Repository Pattern in ASP.NET Core with Adapter Pattern
- Creating an Async Web API with ASP.NET Core – Detailed Guide
- Build Resilient Microservices (Web API) using Polly in ASP.NET Core