I'm Andrew Hoefling, and I work for FileOnQ as a Lead Software Engineer building mobile technologies for Government, Financial and First Responders using Xamarin. 

 

.NET 5 and The Future


Microsoft Build 2019 was this week and lots of big announcements are coming from Microsoft with what the future of .NET and the ecosystem of developer tools looks like. This year there was a HUGE announcement about the future of .NET with the introduction of .NET 5.

Richard Lander of Microsoft blogged on Monday (May 6th) Introducing .NET 5 which outlines the future of .NET and how the different runtimes/frameworks will be unified. .NET 5 is the vNext of .NET Core but Microsoft is removing the Core branding from it.

Overview of Changes

.NET 5 is the introduction of a shared .NET API that will create drop-in replacements for the different platforms where .NET currently runs. Currently there are many different versions of .NET that run on many platforms

  • Mono
  • .NET Framework
  • .NET Core
  • Xamarin.iOS
  • Xamarin.Android
  • etc.

With the different versions of .NET running on all the various platforms there has been a struggle to keep the different versions consistent. Microsoft simplified this problem and unified the frameworks by creating the .NET Standard which was first announced 3 years ago at Microsoft Build. The idea back then was to have a set of APIs that a version of .NET would implement and then the library could run on any of the frameworks.

.NET 5 and .NET Standard

What is the life of .NET Standard and will it be going away? 

.NET Standard is not going anywhere as far as I understand and will be very important to the success of .NET 5 as the code-base get's unified. With .NET 5 the idea is to create a shared Base Class Library (BCL) that will have different runtime virtual machines. 

  • MonoVM
  • CoreCLR

The idea is you can have drop-in replacements with the different runtime VMs but it will all be 1 .NET.

What Happened to .NET Core 4?

As the APIs and Runtimes are unified to .NET 5 there is the question of what happened to .NET Core 4 as .NET 5 is really .NET Core vNext. Since the .NET Framework is currently on version 4 skipping to .NET 5 will reduce confusion between .NET 5 and .NET Framework.

When ASP.NET Core first came out before the Core branding Microsoft went through heavy confusion among developers on what was what.

This is a really great idea to skip the version

.NET Framework is Legacy

This comes as no surprise to me as Microsoft has made many hints over the past several years that .NET Framework is becoming more and more a legacy framework. When it was announced that .NET Framework would not be included in some of the newer technologies I started making recommendations to focus on a migration strategy and build greenfield apps on the new technology.

Microsoft has been hard at work on

  • .NET Standard 2.1
  • .NET Core 3.0

The announcement of .NET Standard 2.1 came last year which clearly stated that .NET Framework 4.8 will not be supported and it will work on .NET Standard 2.0. This announcement was a big confirmation to me that .NET Framework is becoming more of a legacy technology. The announcement this week confirms our suspicion about the future of .NET and that we should be building new products on .NET Core and migrating .NET Framework projects to .NET Core.

Open Source

This week Microsoft announced this plan was put into action in December of 2018 and since .NET is all Open Source some people have been noticing what is going on. I personally have been working on a pretty significant change to .NET Core/Mono/.NET Standard for ObservableCollections and you should check it out!

While working on this Pull Request I learned that all of the projects are tightly coupled together with a code-sharing strategy. 

When I was working on the Pull Request I started in the Mono project and was told that the change belongs in CoreFX and the code will be transfered over automatically. As part of my work in CoreFX I needed to make changes in CoreCLR and was told the exact same thing. To complete the new feature I made several Pull Requests to the CoreCLR project and then updated the CoreFX Pull Request once things were copied over

Watching how all of these things connected was fascinating and with the announcement it all makes sense. All the libraries really use the same BCL.

My Take On It

Software Development is an iterative process: Respect the Process

The future of .NET is very bright and to bring everything back together to make a unified API that is cross-platform is a powerful runtime. With .NET Standard I could easily share code between the different platforms but now with .NET 5 my code sharing and reusability increases.

History tells us it has come full circle where we went from 1 Framework to rule them all to many different Runtimes/Frameworks and we are back to 1 Runtime to rule them all. The major difference is the new runtime is cross-platform and doesn't have a heavy installation package such as the .NET Framework. Lightweight and Portable are the key take-aways.

Xamarin

I spend a lot of my time working on Xamarin projects, when I first got started in Xamarin I had to constantly remind myself that I am using Mono and not .NET Core for my Xamarin.iOS and Xamarin.Android projects. .NET Standard made this incredibly easy to share code between the different apps of large applications regardless of where it was written.

I see .NET Standard still being a big part of Xamarin development, as Xamarin projects are still off on their isolated project structures being able to use .NET Standard 2.0 for shared business layers regardless if it is .NET 5 or .NET Framework makes a difference in code re-usablitiy.

Moving forward with .NET 5 and the MonoVM that is going to be used we will be able to gain access to all of the improvements that are coming in .NET 5 and beyond. Prior to this announcement we would have to get the changes included in .NET Standard which can be a complicated process.

This doesn't mean .NET Standard won't be important to Xamarin but if you are writing let's say Xamarin.iOS or Xamarin.Android for example you can write platform specific code with the latest and greatest API changes in .NET 5. 

.NET Core

.NET 5 = .NET Core vNext

The real change in .NET Core is the branding from .NET Core -> .NET

The exciting change I see for .NET with this branding change is better utilization of development resources, as time won't be spent making the different implementations of .NET consistent. The development time can be spent towards making amazing new APIs and performance improvements across the runtime of .NET 5.

By unifying the runtime into .NET 5 we will see a wider use of new APIs

Technology Left Behind

All of these announcements are FANTASTIC but let's not forget that this announcement confirms that .NET Framework is going to be left behind and many other popular Technology Stacks as well. During Microsoft Build I grabbed this screenshot and tweeted it out.

You and your team will need to identify a migration plan to move from these old legacy technologies to the new powerful .NET 5. You have plenty of time to migrate as .NET Framework will be supported until 2029. However teams should start investigating the effort to migrate vs re-write their applications in .NET 5 technologies. 

DNN

I spend a lot of my Open Source time in DNN (Formerly DotNetNuke). A migration plan to .NET Core has been a hot topic for several years. There are no plans to migrate WebForms to .NET 5.

The closest model to WebForms is Razor Pages or Blazor and Microsoft's statement from Microsoft Build is WebForms developers should re-build their application in Blazor as it is the closest programming model.

As I continue to work with the Technology Advisory Group at DNN, I have been working on a Razor Pages module pipeline that will start building the foundation for a migration plan off of WebForms and to .NET Core which will then be .NET 5.

This migratin plan is applicable to anyone that has a WebForms project that is trying to get to .NET 5 or .NET Core 3 in the short-term.

Summary

This announcement has confirmed many suspicions that I have had about the direction of .NET and what is happening with .NET Framework. I can now easily cite the announcement of .NET 5 when talking technologies and making recommendations to use the current version of .NET Core as it is the recommended approach going forward.

The announcement of .NET 5 means we live in exciting times for .NET developers


Share

Tags

Microsoft Build.NETdotnet core.NET CoreMonoCoreCLRCoreFXBCL.NET FrameworkXamarinDNNMicrosoft Build 2019