.Net Core is an exciting framework to work with and if you’re wondering what is this fuss about, I’ll explain everything in just 12 statements.
Let’s not wait anymore and start!
1. .Net Core is a completely new framework
.Net Framework and .Net Core are completely separate frameworks. But why Microsoft decided to create something from scratch? Let’s see what are the drawbacks of .Net Framework:
- it works only on Windows
- it’s big, not modular
- it’s not open-source
- hosting ASP.Net pages is slow
As contrary to that a new framework was created – .Net Core. It runs on Windows, Linux and MacOS, is open-source and is designed with web requests handling in mind.
2. It’s fast
.Net Core is an open-source project, which means, that it’s sources are available online. Take a look at the page of .Net Platform on GitHub.
Over 190 repositories within this platform! But what does it mean, it’s open-source?
- if you’re wondering how the framework method is written or what it does underneath, you can just go and have a look
- developing .Net Core is no longer in hands of Microsoft employees, but also in the hands of the whole community around .Net Core. This is why the development of .Net Core is so fast and new features are coming almost every month
- if you found a bug, you can raise an issue on GitHub or create a pull-request. You can become a framework contributor, how cool is that!
4. Simpler and more compact
If you take a look at the project structure, you will immediately see the difference between frameworks. Here is a project structure of .Net Core on top and .Net Framework underneath.
Those projects were created from a template from Visual Studio. Notice that .Net Core needs just one package, where .Net Framework needs the whole bunch of assemblies to start working.
Not let’s have a look at project files.
.Net Framework on the left, contains a lot of configurations and settings, whereas .Net Core doesn’t need anything like this. It’s much easier to read and to work with. What’s more, as our project gets bigger, this file will not grow so much as in .Net Framework, so it will still be very readable and great to work with.
This is what I already mentioned, but I wanted to emphasise it even more. .Net Core is a multi-platform framework and this means:
- we can run .Net Core project on Windows, Linux, and MacOS
- we can develop .Net Core projects on above systems with Visual Studio or Visual Studio Code
- we don’t need IIS to ASP.Net Core pages
- we can host .Net Core on many servers, like:
- Azure app service
There is also a very hand .Net Core CLI, a command language, what works on multiple OSs, that we can use to:
- build project
- run test
- publish project
6. Many things are supported out of the box
.Net Core offers quite a lot without installing many additional packages. It was designed with fast request processing in mind, so it’s ideal for creating Web APIs. As a result of that, writing a Web API from scratch is trivial, as well as adding many necessary features that you need:
- Dependency Injection
- JSON support
- easy configuration binding
- Polly – retry mechanism
.Net Framework is a big framework. In software development changing, testing and releasing big projects is hard and requires a lot of time. This is why .Net Framework wasn’t released frequently and wasn’t changing very rapidly. .Net Core however is modular and contains of more than 190 repositories, what does that mean? Theoretically:
- every module can be worked on separately
- every module can be released separately
- work can be better distributed and done more in parallel
This proves right as .Net Core is developing rapidly, especially when you look at integration with Azure cloud.
Another advantage of having modular framework is that you only reference packages that you need. Because of that your app will be lighter and will be quicker to publish.
8. There are windows!
Yes! And this is a surprise for me, that .Net Core from version 3.0 has a Windows Forms implementation. This package contains most popular elements from WinForms as I know from the old days. This is very exciting, because you can benefit from all the goodies of .Net Core (performance, modularity), but the looks stay the same. Sadly there are no plans to make Windows Forms multi-platform, so you won’t be able to run in on Linux or MacOS.
9. .Net Core 3.1, what’s next?
Take a look at this graph:
On the top there is a line representing the development of .Net Framework and on the bottom, one that represents the development of Mono. FYI, Mono is a .Net Framework implementation that runs on Linux, but doesn’t support all of its features. In the middle, there is a .Net Core development.
.Net Core will contain all of the best features of .Net Framework and Mono and will build on top of that. What’s more, Microsoft says that .Net Core is the future and it is the framework that they will support. You may noticed, that next version of .Net Core will be called .Net 5. This is because version 4 could confuse developers.
When it is coming? Soon – around November 2020. What’s new, .Net 5 will support IoT – mobile phones and gaming – XBOX. This means that a library once written can be used in all of those cases and I’m sure that development of new features will even increase.
10. You don’t need to rewrite everything
If you think of trying out .Net Core, but still using .Net Framework, don’t worry. .Net Core and .Net Framework can work together. .Net Framework 4.6.2 can reference .Net Core 2.0 libraries and higher versions of .Net Framework supports a higher version of .Net Core.
I personally work in a solution, where we have multiple older projects in .Net Framework, but a few ones in .Net Core as well, working together.
Also, if you’d like to write code in .Net Core, that can be run on Xamarin or UWP, you can target .Net Standard, which is a common set of APIs, that works everywhere.
Important note – porting existing projects to .Net Cora can be trivial or not possible at all. The problem might be with legacy libraries that were written for .Net Framework and will not work on .Net Core. In those cases you would need to rewrite you project to use different libraries and that can take time.
Many thins in .Net Core is rewritten or written anew, so methods and interfaces might differ. However, most changes are in configuration, dependency injection and handling request pipeline.
11. Should I learn it?
Yes! There are many reasons, but let’s look at the most important ones:
- Microsoft says it’s the future and will be maintained and developed
- It’s easy to work with, multi-platform and open source
- It’s fast!
12. Stay informed
One last thing, as an addition. If you like this post and you’d like to stay informed about .Net Core, let’s stay in contact:
You can also learn .Net Core 3 with me on Udemy. Here is a link to the best possible offer. I’m sure you won’t get disappointed: https://www.udemy.com/course/microsoft-aspnet-core-30/?referralCode=8CD54D26BD8929CC27EB
That’s for reading, cheers!