12 mars 2018

.NET Core and why it matters to .NET developpers

Microsoft’s vision; the road so far

In November 2014 Microsoft announced their vision for a .NET Framework that spans cross-platform support, which they released under the name .NET Core. It encompasses a number of projects which fall all under the umbrella of the .NET Foundation organization, meaning they are open source, easy to contribute to, and part of an open source .NET ecosystem.

Three of these projects are so central to this initiative that I need to specificaly mention them.

1. The .NET Core runtime CoreCLR

It differs from the desktop .NET Framework runtime in that it is both cross platform and cross architecture. Though other than that it is fairly similar to its desktop counterpart, including the same .NET Garbage Collector – or GC.

Developpers can choose to deploy it along with their application, or rather as part of their application, to run it on Windows, Linux or macOS.

2. The .NET Core foundational libraries CoreFX

This is fairly intuitive, CoreFX is the usual libraries that .NET Framework developpers are used to.

Not all of them have been made available yet, I’m still waiting for DirectoryServices and SignalR to come with .NET Core 2.1. But the approach has been taken to separate the libraries in a lot of smaller NuGet packages, instead of a few big ones, which is more in line with today’s conventionnal development pratices.

Also it is worth noting that mscorlib is not part of CoreFX, as it is a runtime-specific library.

3. The .NET Core command-line tools CLI

A set of tools used to create, build, test, package, run,… your applications. More information there : https://docs.microsoft.com/fr-fr/dotnet/core/tools/?tabs=netcore2x

Speaking of conventionnal development practices, .NET Core embraced them, which is one of the reason why I’m a big believer in the projet.

From a .NET Framework developper approach, it went full open source, let go of csproj file directly referencing the source files, splited big libraries into smaller, more specialized ones, and a lot more.

In June 2016 was released .NET Core 1.0 and ASP.NET Core 1.0, allowing the first cross plateform application to be build. .NET Core 1.0 was well received, but it was also clear that it was too young to be used as prominently as its older relative .NET Framework.

On august 2017, Miscrosft shipped .NET Core 2.0 along with new version of Visual Studio and .NET Standard 2.0 which tried to answer most of the community feedback

  • A broader scope of APIs: by implementing .NET Standard 2.0, .NET Core 2.0 came with more than 90% of the existing APIs in .NET framerwork
  • Nearly three fourth of nuget.org packages are now compatible with .NET Core projects
  • An update on supported OS (SUSE was added) and supported OS version (drop support for older version and add support more recent ones, including latest),
  • Improved performance : https://blogs.msdn.microsoft.com/dotnet/2017/06/07/performance-improvements-in-net-core/

The whole ecosystem was also improved with the features of Visual Studio 2017, more recently a very welcome performance improvement. But before that, native support for live unit testing was added and live detection of unit tests are currently in preview, to name only those two.

The Core 2.0 framework then gained great traction amongst developers.

Microsoft suggested on both msdn and in the Microsoft Visual Studio YouTube channel that .NET Core  aims to supersede .NET Framework developments, when applicable.

.NET Core is the recommended development platform for the use cases described here https://docs.microsoft.com/en-us/dotnet/standard/choosing-core-framework-server, which are areas for which efforts are going to be put into improving the .NET Core platform, while .NET Framework will enjoy mainly fixes and maintenance.

The areas have a strong focus on performances and server side applications, which is where a lot of industries are moving their focus as well.

As of now,  .NET Core is cross-plateform, cheaper to run (deployable on Unix server), easier to deploy (docker compatibility, Core CLI to install .Net Framework, etc..), more performant and more developer friendly than .NET framework. It also stands his ground against other frameworks according to various benchmarks ( https://github.com/aspnet/benchmarks & http://benchmarksgame.alioth.debian.org/ ). Despite that there is no intention to replace the well known .NET Framework, .NET Core is not shipping any UI framework (WinForms / WPF). While some industries are moving towards server side applications with a web front, not all and there is still a place for .NET Framework.

What comes ahead

1. Community involvement

I strongly encourage interested readers to have a look at the Microsoft Visual Studio YouTube channel and .NET Core related videos (missing link). The speakers there explain sensibly the scale of the involvement of the community.

As a broad overview: In 2017, .NET Core saw between 2 thousands and 3 thousands community pull requests per month on github – about half of the total pull requests.

Samung embraced the project, and Illyriad Games is contributing, to name only these two. Microsoft is now the biggest community under GitHub : https://msdnshared.blob.core.windows.net/media/2017/03/msoss.png

Having read some documentation on .NET Core, one probably noticed that it tends to lend itself fairly well to server-side developments. There’s a lot of reasons for that, not the least of which is the cross-platform quality of .NET Core allowing you to switch – with a varying degree of work – between windows and linux servers.

Another reason is ASP.NET Core. The video game industry has started contributing to improve the performance of ASP.NET Core, Illyriad Games has been partly credited for the good performances of ASP.NET Core in techempower.com’s benchmarks during November 2016’s round.

2. A continued improvement of the ecosystem

This is not specific to .NET Core, but there’s another open source project that falls under the .NET Foundation that is very much worth mentionning: the .NET Compiler Platform, also known as Roslyn.

Roslyn probably deserves its own article, it is an open source compiler for C# and VB that is exposing APIs to all steps of the compiler pipeline.

Powered by Roslyn, and with a more rapid cycle of releases, Visual Studio 2017 is being improved faster than any previous VS and offers even more flexibility for custom improvements.

The ecosystem in which .NET Core is growing is not limited to Visual Studio. The latest improvement of C#, the evolution of .NET Standard and the growing number of .NET Foundation projects  – of which NUnit is one of the more recent – are strong indicators that the open source .NET ecosystem is not going anywhere and will continue to grow.

3. The Microsoft syndrom

It isn’t the first time Microsoft unveiled new technologies or tooling to the public, sometimes only to see it not being fully adopted or downright fail and support dropped.

  • Git is as popular as ever whereas Team Foundation Version Control, which is part of TFS, is struggling to gain new users
  • Silverlight is no longer being developped unless for various fixes, and support will be dropped in 2021
  • More than 10 years after its release WPF has still not superseded WinForms for a number of Windows applications
  • CodePlex (even though it was open source) was recently closed https://blogs.msdn.microsoft.com/bharry/2017/03/31/shutting-down-codeplex, in large part thanks to the success of GitHub

Why is .NET Core different ? The approach this time is in line with a number of needs and industry good practices.

C# and its newer versions are being pushed heavily into the open source community, which can only help the community be more familiar with various Microsoft technologies.

As said earlier, development pratices also tend to follow what is “standard” today.

It is a real business enabler for Microsoft, by virtue of people having more options as to where they want to deploy their binaries (linux, windows…), more people may choose to go to Azure, a bigger and bigger source of revenue for the tech giant.

Ensuring .NET Core is successful allows Microsoft to be hopeful about more applications being deployed into Azure.

For the very same reason, we can benefit from the strength of .NET and not be limited to the – sometimes expensive – Windows ecosystem, and be able to switch from one backend server to another. This also helps to reduce licensing costs.

I want to try it out

You are in luck. As .NET Core is open source, so is most of the tooling needed to try it out.
Visual studio ( https://code.visualstudio.com/ ) code is a full, cross plateform, free version of visual studio aimed at producting .Net Core project with hundred of programming languages supported (Python, C#, Go, Php, Ruby, TypeScript, Java, Javascript, etc..)

Github is hosting all of .NET Core related repositories if you want to look into it. Here is the CoreCLR https://github.com/dotnet/coreclr/. Browse the common repo to dig into it.

MSDN is hosting a lot of sample example for .NET core sample : https://docs.microsoft.com/en-us/dotnet/core/get-started from an hello world to a complete solution using CLI on unix


.NET developpers today are lucky enough to experience this period of development of a new .NET ecosystem, one that embraces open source and a conventionnal development model.

They are given the opportunity to be part of this development thanks to the way this new ecosystem evolves and there may not be a better way to grow as a .NET developper than to size this opportunity.

If not, at least trying out new tech is always fun.

Écrit par Grow Together