ASP.NET Core is a new framework for building web applications from Microsoft. It succeeds the older ASP.NET. This article introduces and provides an overview of ASP.NET Core.
Table of Contents
What is ASP.NET Core
ASP.NET Core is a high-performance, cross-platform, open-source framework for building modern web applications.
ASP.NET Core is not the next version of ASP.NET. It is an entirely new version that was redone from the ground up and optimized for performance, modularity, and flexibility. Several architectural changes result in a much leaner, cleaner, and more modular framework.
ASP.NET Core can run only on .NET / .NET Core.
ASP.NET Core up to version 2.2 ran on both .NET Core & .NET Framework. But since version 3.1, you can only use .NET / .NET Core to develop and run an ASP.NET Core application.
Features of ASP.NET Core
- You can build and run cross-platform ASP.NET apps on Windows, Mac, and Linux (Open source and community focused.
- ASP.NET Core unifies MVC and the web API.
- Ability to host on IIS or self-host in your process.
- Built-in dependency injection.
- Easy integration with client-side frameworks like Angular, Knockout, etc.
- An environment-based configuration system.
- New lightweight and modular HTTP request pipeline.
- Built on .NET, which supports true side-by-side app versioning.
- Ships entirely as NuGet packages.
Cross Platform support
One of the critical features of ASP.NET Core is its ability to run on multiple platforms, including Windows, macOS, and Linux, using the .NET runtime. It allows us to build web applications that we can deploy on a wide range of hosting platforms, from on-premises servers to cloud-based services like Microsoft Azure.
Unified Framework
ASP.NET Core offers a unified framework for building a wide variety of applications. You can build the following application using the framework.
Minimal APIs
Minimal APIs allow developers to quickly create lightweight and simple APIs that mobile or browser-based applications can consume.
Web APIs
The Web API is another approach for building HTTP API using MVC design pattern.
MVC Controllers
This approach uses the trusted and tried MVC (Model View Controller) used in the previous edition of ASP.NET MVC. The pages are rendered on the server side and sent to the client.
Razor Pages
Razor Page is a page-based framework that simplifies the building of web pages. It is similar to MVC but simplifies controllers and views into a Razor Page.
Blazor
Blazor is a set of new APIs for building interactive client-side web pages using C# instead of JavaScript. We can render the page on the server side or the client side.
gRPC APIs
ASP.NET Core supports gRPC API, which enables us to communicate between distributed systems using the gRPC protocol.
Ability to Self Host
ASP.NET Core applications are no longer tied to IIS. The applications are embedded with a built-in, lightweight web server called Kestrel. This enables us to self-host ASP.NET Core or run it behind any server in the reverse proxy configuration like NGINX, Apache, IIS, etc.
Request pipeline
ASP.NET core application Modular in nature. Using the request pipeline, you can control how to process the request and generate the response. You can plug in the necessary middleware, making the application leaner and more performant.
New Features
ASP.NET Core also includes several new features and improvements over the original ASP.NET framework, such as built-in support for dependency injection, a new configuration system, and a streamlined HTTP pipeline. Additionally, ASP.NET Core supports multiple programming languages, including C#, F#, and Visual Basic.
ASP.NET Vs ASP.NET Core
There are two flavors of ASP.NET available now.
ASP.NET
ASP.NET is the older version of ASP.NET. It needs .NET Framework to run. The Latest version is 4.8.1
ASP.NET Core.
ASP.NET core is the new way to build the Web application. It can run on .NET (Previously known as .NET Core). The current version is 7.0
ASP.NET | ASP.NET Core |
---|---|
Current Version 4.8 | Current Version 7.0 |
Legacy version | The complete redesigned version of ASP.NET |
Runs on Dot Net Framework | Runs on both .NET / .NET Core |
Runs Only on Windows | Runs on all Platforms |
Stable version with Rich Features. | Stable version with Rich Features. |
WebForms are supported | WebForms will not be supported |
Bulky. System.web.dll | Smaller, leaner and Modular |
Proprietary to Microsoft | ASP.NET Core is Open Source |
What happened to ASP.NET 5
ASP.NET core was originally named as ASP.NET vNext
Later it was changed to ASP.NET 5.
Finally, Microsoft named it as ASP.NET Core when the 1.0 was released
ASP.NET Core Roadmap
You can read about NET Roadmap