What are the advantages of NET Core?

07 Dec.,2023

 

Advantages of .Net Core

Jatinder Singh

·

Follow

5 min read

·

Oct 2, 2020

--

Advantages of .Net Core

There was increasing demand of software developers and organizations for a cross-platform .Net development environment. To accomplish that, Microsoft was essentially going to have to rewrite significant portions of .NET, ASP.NET, and NET Framework, so this was a perfect opportunity to make additional changes to the platform. Not only providing the advantage of cross-platform environment, .Net Core has several advantages over the traditional .Net environment. Let us get into the details of each advantage .Net Core provides:

1. Open source

.NET Core is truly open source, not just source open. All the code and all of the documentation are all truly open source. As a matter of fact, there were over 10,000 contributors that were non-Microsoft employees. And this is really helping drive adoption in traditionally non-Microsoft or not .NET-friendly organizations, knowing that the entire framework is open-source. You can go to the github at following url and download\clone\fork the entire source code and start contributing

https://github.com/dotnet/core

2. Cross-platform support.

Quite a bit of the impetus for .NET Core was a desire to be able to run cross-platform, and .NET Core and ASP.NET Core delivers.

a. Development methods.

You can develop on multiple platforms including Linux and Mac, and not just Windows. So, if you are on Linux or Mac, you can use Visual Studio Code, and there’s also Visual Studio for the Mac for building .NET Core or Xamarin-based applications.

b. Deployment including Containerization (Docker, Service Fabric, Kubernetes etc)

You can deploy to Windows, Linux, or Mac, and more and more distributions are coming online with every release, plus additional versions. Containerization also simplifies deployment because once you have it working on, “development machine” in the container, you don’t have to worry about environmental configuration or deployment processes to move it to integration or production. You can simply move the container. Containerization support including Docker and Kubernetes is built into Visual Studio .

3. Performance.

Another advantage of .Net Core is performance. If we think of where ASP.NET came from, Web Forms and in MVC, there was a lot of legacy code out there and performance wasn’t necessarily one of the stronger point, but with .NET Core it is one of the key advantage.

One-way ASP.NET Core gains a lot of performance is by using Kestrel. Kestrel is an open-source, cross-platform web server based on “Libuv”, a very popular open-source server, and using Kestrel, ASP.NET performs in the top tier of the standard benchmark tests. And with every release, performance of .NET Core and ASP.NET has improved.

4. Portable Class Libraries via .NET standard.

Portable Class Libraries has been around for a while with mobile deployment, Silverlight, but it was not necessarily well-executed. There were different profiles and they were numbered, and there was some confusion around it. .NET Standard significantly cleans that up. It is a formal specification for all .NET runtimes.

There are three key scenarios that are being targeted with .NET Standard.

a. Uniform set of base class library APIs, independent of workload.

b. Enable production of libraries that are usable across all .NET implementations.

c. Reduces (or eliminates) conditional compilation.

To sum it up, any assembly targeting a .NET Standard version is going to be usable from any other assembly targeting the same version.

5. Modular deployment of .NET Core itself.

There are two different deployment models, Portable Deployment (Different from Portable Class Libraries) and Stand-alone Deployment.

Portable Deployment — Portable deployments rely on the framework being installed, and this is what we expect in the full .NET Framework. .NET framework must be installed, we are going to just put out our libraries and assemblies that we need, and the application will run.

Stand-alone Deployment — Stand-alone deployments contain the required application files, but also the required framework files.

Modular Deployment Model — .NET Core helps overcome the problems of Portable and standalone Deployment and supports true side-by-side installation. This helps in a multitude of ways. If I am running 1.0.0 if that is what my application is dependent on and I install 2.0 or some other version, it does not remove the existing version. So, I can still run my applications regardless of what other versions get installed.

.NET Core and all the Core Frameworks, ASP.NET Core and EF Core, are delivered as NuGet packages instead of having one giant MSI or file that is .NET.

The full .NET Framework is not one giant file, but this is much more granular. Each assembly in a .NET Core Framework has its own package, and the package names match the assembly names. Package versions will use semantic versioning. And this modular deployment model provides faster releases of security updates, bug fixes, etc. Microsoft and the community can just release that specific package with a fix and not have to wait to release the entire new .NET Framework.

6. Full command-line support

Full command-line support not an afterthought and is also a very high priority for .NET Core. There is a very good reason for this. Not all developers developing .NET Core applications will be using Visual Studio, so if only the Visual Studio tools are being developed and the command-line lagged behind, then there’d be a lot of developers left out in the cold and community wide acceptance of .Net Core will also lag. The command-line, of course, works on all platforms, and more and more templates are being used to speed up development, for example, Yeoman — https://yeoman.io/.

7. Interoperability with .NET Framework

With .NET Core 2, we get interoperability with the full .NET Framework. So, that means that .NET Framework libraries can be referenced from .NET Standard libraries. Of course, there are limitations and you can only use types supported by .NET Standard. That gap of what you can use and cannot use is shrinking with every release. .NET Standard 2.0 implements over 32,000 APIs from the .NET Framework. Chances are, what you need will already be in there. If not, it will be there soon.

8. Telemetry around the Visual Studio tooling.

It is completely anonymous and aggregated for use by Microsoft and the .NET Core community engineers, and it enables Microsoft to make sure that they are building and revamping the right things within Visual Studio and not spending a whole bunch of development cycles on features that nobody uses. If you really do not want to be part of that, you can opt out by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable.

Wrap-up

Thanks for reading. Share to give this post some love if you found it helpful.

Thanks

Jatinder

Choose between ASP.NET 4.x and ASP.NET Core

In this article

ASP.NET Core is a redesign of ASP.NET 4.x. This article lists the differences between them.

ASP.NET Core

ASP.NET Core is an open-source, cross-platform framework for building modern, cloud-based web apps on Windows, macOS, or Linux.

ASP.NET Core provides the following benefits:

ASP.NET 4.x

ASP.NET 4.x is a mature framework that provides the services needed to build enterprise-grade, server-based web apps on Windows.

Framework selection

The following table compares ASP.NET Core to ASP.NET 4.x.

See ASP.NET Core targeting .NET Framework for information on ASP.NET Core 2.x support on .NET Framework.

ASP.NET Core scenarios

ASP.NET 4.x scenarios

Additional resources

What are the advantages of NET Core?

Choose between ASP.NET 4.x and ASP.NET Core