What is a .NET framework?
ASP.NET is an open-source server-side web application framework designed for web development to produce dynamic web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, web applications and web services.
It includes a large class library named Framework Class Library (FCL) and provides language interoperability across several programming languages. Programs written for .NET Framework execute in a software environment named Common Language Runtime(CLR), an application virtual machine that provides services such as security, memory management, and exception handling. FCL and CLR together constitute .NET Framework.
What is ASP.NET core?
.NET Core is a cross-platform free and open-source managed software framework similar to .NET Framework. It consists of CoreCLR, a complete cross-platform runtime implementation of CLR, the virtual machine that manages the execution of .NET programs. CoreCLR comes with an improved just-in-time compiler, called RyuJIT.
.NET Core also includes CoreFX, which is a partial fork of FCL. While .NET Core shares a subset of .NET Framework APIs, it comes with its own API that is not part of .NET Framework.
.NET Core is also modular, meaning that instead of assemblies, developers work with NuGet packages. Unlike .NET Framework, which is serviced using Windows Update, .NET Core relies on its package manager to receive update.
.NET core is much better to use while making run time applications:-
1. Cross platform support
Developers can target a single common set of libraries that are supported by multiple platforms:-
- OS X
2. Cross platform development experience
Developers can build applications from various platforms like Windows, Linux, OS X.
3. Minimal Dependencies
Use only the libraries you need within an application resulting into advantages like:-
- More modular
- Smaller footprint
- Reduced impact of upgrades
- Great for mobile and cloud based applications.
ASP.NET Core provides the following improvements compared to ASP.NET:
- A unified story for building web UI and web APIs.
- Integration of modern client-side frameworks and development workflows.
- A cloud-ready environment-based configuration system.
- Built-in dependency injection.
- A light and modular HTTP request pipeline.
So, to sum up, Server side applications can be build effectively with two choices:- ASP.NET core and ASP.NET framework. Both have many similarities like sharing the same .net platform components etc. You can also share codes across each languages. However, which one to prefer on runtime while building a code depends upon your requirements:
You should use .NET Core for your server application when:
- You have cross-platform needs.
- You are targeting microservices.
- You are using Docker containers.
- You need high performance and scalable systems.
- You need side by side of .NET versions by application.
You should use .NET Framework for your server application when:
- Your application currently uses .NET Framework (recommendation is to extend instead of migrating)
- You need to use third-party .NET libraries or NuGet packages not available for .NET Core.
- You need to use .NET technologies that are not available for .NET Core.
- You need to use a platform that doesn’t support .NET Core.