Unique Features of .NET Core Characteristics
Core features that are provided by the ASP.NET Core
1. Built-in supports for Dependency Injection
Dependency Injection (DI) achieves loosely coupled, additional testable code in the applications. In ASP.NET MVC 5/4 or classic ASPX based mostly applications, we tend to use to own separate DI containers used like Unity, AutoFac, StructureMap etc. We had to form up our project to use DI, its additional effort.In ASP.NET Core applications, dependency injection is inherent i.e. no setup headache for DI. simply produce some services and obtainable to use DI.
2. Built-in supports for the logging framework and it can be extensible
3. Consistent across Architectures:
Execute the code with the same behavior in different instruction set architectures, including x64, x86, and ARM.
4. Multiple hosting ways are supported
Introduced a new, fast and cross-platform web server - Kestrel. So, a web application can run without IIS, Apache, and Nginx. The earlier versions of ASP.NET Framework applications can only run on Windows platforms, whereas the ASP.NET Core applications can develop and run on different platforms such as Windows, Mac, or Linux operating systems.
5. Supports Multiple Languages:
You can use C#, F#, and Visual Basic programming languages to develop .NET Core applications. You can use your favorite IDE, including Visual Studio 2017/2019, Visual Studio Code, Sublime Text, Vim, etc.
6. It supports modularity,
so the developer needs to include the module required by the application. However, the .NET Core framework is also providing the meta package that includes the libraries
7. Wide-range of Applications:
Various types of applications can be developed and run on .NET Core platform such as mobile, desktop, web, cloud, IoT, machine learning, microservices, game, etc.
8. Command-line supports to creating, building, and running of the application
9. There is no web.config file. We can store the custom configuration into an appsettings.json file
10. There is no Global.asax file. We can now register and use the services in the startup class
11. It has good support for asynchronous programming
12. Support WebSocket and SignalR
13. Provide protection against CSRF (Cross-Site Request Forgery)
14. Handling Request and Response Pipeline:
We can handle the request and response in the ASP.NET Core application by using the new Middleware Components. In earlier ASP.NET 4.x we generally use Handlers and Modules to handle the Request and Response pipeline. The ASP.NET Core Framework provides a lot of built-in Middleware Components, and we can use those Middleware Components to handle the request and response pipeline
Advantages of ASP.NET Core over ASP.NET :
1. It is cross-platform, so it can be run on Windows, Linux, and Mac.
2. There is no dependency on framework installation because all the required dependencies are shipped with our application
3. ASP.NET Core can handle more requests than the ASP.NET
4. Multiple deployment options available withASP.NET Core
Core Parts of NET Core Platform -
1. .NET Runtime: It provides a type system, assembly loading, a garbage collector, native interop and other basic services.
2. Fundamental Libraries: A set of framework libraries, which provide primitive data types, app composition types and fundamental utilities.
3. SDK & Compiler: A set of SDK tools and language compilers that enable the base developer experience, available in the .NET Core SDK.
4. CLI Tools: A set of tooling for development and deployment.
5. Roslyn: Language compiler for C# and Visual Basic
6. CoreFX: Set of framework libraries.
7. CoreCLR: A JIT based CLR (Command Language Runtime).
What the ASP.NET Core Doesn’t Have?
1. The Global.asax file
2. Web.Config file
3. HTTP Handlers and HTTP Modules
4. ASP.NET Page Life-Cycle model
.NET Core (.NET) vs ASP.NET Core:
ASP.NET Core and .NET Core are not the same. They are different, just like ASP.NET and .NET Framework are different. ASP.NET Core is a fast, lightweight, modular, and open-source framework for creating Web Applications, Mobile Applications, and Web Services that run on Windows, Linux, and macOS. .NET Core is a software platform or you can say Runtime Environment on which ASP.NET Core applications run.
.NET Core (.NET):
.NET Core (.NET) is an open-source and cross-platform
.NET Core is a runtime to execute applications that are built on it.
Install .NET Core Runtime to run applications and install .NET Core SDK to build applications.
.NET 7 is the latest stable version. .NET 8 is in Preview.
NET Core is Open Source and Cross Platform Framework.
ASP.NET Core is a Web Application Development Framework to build Web Applications, IoT Applications, and Mobile Applications, which is going to be run on the top of the .NET Core Platform. If you are developing an application using ASP.NET Core 1.x or 2.z, then you can run the ASP.NET Core Application using both .NET Framework and .NET Core Platform.
If you want to develop and run .NET Core Applications, you need to install .NET SDK, including the .NET Runtime. If you only want to run .NET Core Applications, then you only need to install .NET Core Runtime.
NET Core 7 is the latest stable version, and ASP.NET Core 8 is in Preview.