12 things you need to know about .Net Core

.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

If we take all the hosting frameworks, .Net Core will be in the top 3, which is already impressive. However, if we take a look only at popular languages and frameworks, ASP.Net Core will be well ahead of the competition. Just take a look at popular hosting frameworks like netty for Java, nginx for C or nodejs for JavaScript. This may be one of the biggest reasons why to switch to .Net Core.

3. Open-source

.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.

5. Multiplatform

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:
    • IIS
    • Azure app service
    • Docker
    • Ngnix
    • Apache

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
  • logging
  • easy configuration binding
  • Polly – retry mechanism

7. Modularity

.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 the 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’t work together directly, but you can build your library targeting .Net Standard. .Net Framework 4.6.2 can reference .Net Standard 2.0 libraries and higher versions of .Net Framework supports a higher version of .Net Standard. All supported versions are listed here, at the bottom: https://dotnet.microsoft.com/platform/dotnet-standard.

I personally work in a solution, where we have multiple older projects in .Net Framework, but a few ones in .Net Standard as well, working together.

.Net Standard is a subset of libraries of .Net Core, so you have most of the features available, but you can write code the supports older frameworks.

Important note – porting existing projects to .Net Core 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 your 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!

5 thoughts on “12 things you need to know about .Net Core

  1. slavof

    You wrote:

    >>What’s more, now Windows Forms would work for Linux and MacOS as well <<

    Well, that is simply not true, beacuse Windows Forms in .NET Core is still a .NET wrapper over Windows user interface libraries, such as User32 and GDI+. So it is only for building Windows desktop applications. It will not work on Linux and/or MacOS. Same for WPF. And there are no plans to make it work outside Windows.

    — s.

    Reply
  2. Marcin Sulecki

    Thanks for your post but I have one remark…
    You wrote that .Net Core and .Net Framework can work together. .Net Framework 4.6.2 can reference .Net Core 2.0 libraries. How can this be done?

    I tried to add to WinForms a .net core 2.2 assembly. In result I have a error during build: “Project ‘MyApp.csproj’ targets ‘netcoreapp2.2’. It cannot be referenced by a project that targets ‘.NETFramework,Version=v4.7.2’.
    In .NET Core 3.1 the same.

    To my knowledge you can only use .net standard 2.0 together. Or I don’t know something

    Can you explain it?

    Reply
  3. Dee

    Thanks for the post. What do you think about Blazor? Is this a good technology to go for someone who wants to start with web development using .Net? Or should I rather go with mature JS frameworks like Angular, React or Vue?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *