The question I had was “What is exact the difference between .NET Core and .NET Standard (and when to use it)?” and “Why should we migrate?”. So, the best way to find that out, is to convert an existing project while reading all the documentation.
You can compare .NET Standard to an Interface and .NET Core to a Class. The main purpose of .NET Standard is to share your code between different runtimes like .NET Core, Xamarin, … It’s important that those runtimes implement this specification.
It’s also good to know that the higher version of .NET Standard contains more APIs but is less supported by platforms. So, my advice is to use the lowest version as possible to have more support. We can say that a .NET Core Class Library is built upon the .NET Standard. With .NET Core you can make an executable project, not with .NET Standard. For more info: .NET Standard versions.
In a real-world example, I used .NET Standard for a Domain Class Library. I noticed that I still can reference to existing .NET Framework class libraries. I used .NET Standard here to be future proof. When we may be going to write a Xamarin application, I can use and share this library. It will also be platform independent.
The corresponding (NUnit) test project is created using .NET Core because we need to execute the tests.
For the Base Library class which I’m going to use for the different projects and solutions I used again .NET Standard because I want to be able to use it for every project and platform.
For the REST API I used an ASP .NET Core project. Not much is changed but ApiController for example is now migrated, so you can’t use it anymore as a base class. You can still use it as an attribute (since .NET Core 2.1). I hope I can see the performance improvements in the future.
By using .NET Standard projects, I can reuse them for different views like Xamarin, WPF, …. Maybe at this moment your projects don’t need to support different platforms.
For the communication to the backend I created a .NET Standard library.
As a consultant and an early adopter, I always want to use and learn the latest versions. So, I will always choose for migrating to the latest versions. But the customers don’t always have the time and budget to migrate.
I don’t tell the customers to migrate just to be on the latest version. But to be ready for the future, I would suggest migrating to .NET Core. You don’t need to migrate your whole solution at once. You can for example start by migrating an existing library to the .NET Standard. That’s for me a big advantage. That way you can quickly migrate base libraries. It’s also a good practice to separate business code from your views if you have an old code base. I know the migrations I did in the past would be a lot easier if .NET Core and especially .NET Standard was available.
New projects I would create in .NET Core.
And remember that .NET Standard is, according MSDN: One Library to Rule Them All.
Summary of the advantages
Summary of the possible disadvantages
What I didn’t cover in this article is that we also must take our automatic deployment into account. If you migrate you project, you must keep that in mind.
.NET Core 3.0
This year (September / November) .NET Core 3.0 will be released. The biggest change is that it will desktop support (winforms / WPF) and C#8
.NET 5 and beyond
In the future we will have just one .NET (Windows, IOS, Linux, Android, …). The release is scheduled for November 2020. For more info: https://devblogs.microsoft.com/dotnet/introducing-net-5/
So, with this knowledge I suggest everybody prepare for migration to be future proof.