.NET Core is the latest buzz from Microsoft that every .NET developer is talking about these days. But still there is a lot of confusion around the big thing “.NET Core”. Well, this article is all about understanding the technology and provide you all the information you need to know before writing that “Hello World” program in ASP.NET Core.
“We want to remove every restriction on why you would choose not to use our technology”, this was the statement Scott Hunter mentions that came up while the .NET team was planning their next release a few years back. Catering to everyone meant they had to go cross platform. But there was more to it, not only they started working towards making the technology cross platform but also they moved to open source environment and improved performance was one of the major objectives. So, the team started working in this direction and came up with DNX (Dot NET Execution environment) which later evolved into the CLI in .NET Core.
ASP.NET 5 or .NET Core. What is it?
You must have been hearing all the new terms like ASP.NET 5, .NET Core 5, .NET Core 1.0 and wondering what really the name of the product is. So, before getting into the nitty-gritty let me tell you that “.NET Core” is the product and currently is at version 1.0.
ASP.NET is a very successful and established brand. So, when the guys at Microsoft came up with the new framework they planned to name it ASP.NET 5 as in continuation to the existing .NET version. This was done to give the developers a sense of familiarity that this is just the next level of what they have been already doing with the previous versions of .NET. But in reality the ASP.NET 5 was written from ground up. It was completely new with a brand new CLR. It would have been wrong and confusing to give it a brand name that was of an existing product. So, the team came up with a brand new name for the brand new product which is .NET Core 1.0. The following images will give you a better understanding of the transition in the branding.
Some cool .NET Core features.
Let’s take a look at some of the .NET Core features which makes it a real deal.
Cross-Platform : You heard it right, .NET Core applications can be developed and deployed on Windows, Mac and Linux. There are a host of development tools that you can choose from as per your convenience, some of which are Visual Studio, Sublime Text, Emacs, Visual Studio Code. It means no matter what platform you use or what editor you feel comfortable using, you can go ahead and start building ASP.NET Core applications.
For deployment you are no longer limited to windows environment, you can now deploy on the platform of your choice because .NET Core application can be self contained. Which means the deployment package will contain all the dependencies including the .NET Core runtime.
Open Source : Your .NET Core is completely open source and accepts contributions. You can head to the GitHub repository for .NET Core and check the code, suggest modifications or request a new feature.
Modular : Unlike .NET full framework .NET Core is lightweight and is completely modular. Which means you can choose to have only the assemblies you need and skip the ones which are of no use to you. You can use nuget packages to pull in the features you want. This modularity results in a smaller footprint of your application.
These are some of the many cool features of .NET Core. If you noticed there is one thing very prominent in all of the features – “Choice”. Yes, Microsoft this time has kept the freedom of choice for the developer in mind which gives a lot of flexibility.
What is .NET Core made up of?
Till now we know the what .NET Core is and what features it offers. Now, let’s take a deeper look at the framework, the components it is made up of.
The Common Language Runtime (CoreCLR) : This is a lightweight monolithic component of the framework which includes services very similar to the .NET framework’s CLR. The services include memory management, Just in time (JIT) compiler and the exception handling mechanism.
The Base Class Library (BCL) : The BCL contains the minimum libraries that are required for application development like console class, primitives, string types, threading etc. Other libraries can be plugged in using nuget. This is what brings molecularity into picture.
The Command Line Interface (CLI) : This is the cross platform command line interface for .NET Core. You can directly work with the CLI using the commands and all the IDEs like Visual Studio and Visual Studio Code use CLI under the hood. So, the level of interaction with the CLI depends on you.
Comparison between .NET Core and .NET framework.
By now you must be familiar with the differences between .NET Core and .Net framework, but lets do a quick comparison.
Modularity : .NET framework is monolithic and is part of the operating system, which means even if you are not using all features of the framework, you have them in your bag as it is packaged in one. Whereas .NET Core is modular and the required features can be pulled in using nuget as and when needed.
Cross-Platform : As .NET framework is part of the operating system, it is limited to Windows eco system where as .NET core is cross platform.
Application Types : .NET Core can be used to develop console applications and web applications using MVC and WebAPI. .NET has a much more application types available including MVC, WebAPI, Web pages, WinForms, WPF, etc. .NET Core is still growing and it will take some time to get all .NET framework features implemented.
Languages : Currently .NET Core supports C#, VB and F# whereas .NET supports around 39 languages.
No doubt .NET is a matured and stable platform and will continue to be used but the interesting thing would be to see where it goes as the .NET Core platform grows over time.
Installing .NET Core.
Whether you are on windows, Mac or Linux, you can click here and follow the steps to install .NET Core. “You just need a shell, a text editor and 10 minutes of your time.” is what the Microsoft website says.
You can click here to check my article on setting up Ubuntu for developing .NET Core application.
How to get started?
One can start with the .NET Core documentation and play around creating some applications in the tool of your choice.
I will leave you here with these information and a whole new road of .NET Core application ahead of you. Feel free to shoot your thoughts and comments below.