Five Things You Should Know About .NET 5

Posted by: admin
Category: Uncategorized

Five Things You Should Know About .NET 5According to an official blog post of Microsoft, .NET 5.0 is the next big player and successor of .NET Core 3.1 release. In the second week of November 2020, Microsoft posted that .NET 5 has new improvements, updates and features than the .NET Core 3.1. If you’re not aware of the .NET framework, then check out our previous blog posts. For a quick review, it is a software framework initially released on 13 February 2002 and was primarily designed for Windows. .NET has a framework class library and offers interoperability across multiple platforms and programming languages.

In this blog, we discuss the top 5 major updates of .NET 5, and how these features are different from a prior release. 

Let’s dive in;

The Unified Platform

.NET 5 offers a unified version of the .NET world. If you’re a constant user of .NET framework, you must know different flavours of .NET such as .NET Framework, .NET Core, .NET Standard, Mono and so on. .NET 5 is the collective version of all these flavours. It is not only the next version of .NET 3.1; it brings all the flavours of the .NET world in a single version to ease the life of developers. 

.NET 5 offers a common set of API to align runtime of variant applications. It is identified by .NET 5.0 TFM (Target Framework Moniker). TFM delivers developers a token through which they can specify a target framework. As a result, an application can run on any target platform supporting .NET 5. Nevertheless, .NET 5 platform also helps developers to build applications for any certain platform. This shows that .NET 5 was designed while keeping cross-compatibility in mind. 

Latest Features in C# 

.NET 5 brings C#9, which is the new version of the .NET platform’s programming language. And this new programming language carries several important factors;

Top-Level Statement: Top-level statements enable you to write only those coding lines that are essential for limited console programs, utilities by using C#, which is capable of supporting scripting-based approach.

Record Types: The .NET 5 framework allows you to declare immutable reference types.  For example, you’re defining those class-based types that can’t be altered after their creation.

Init Setter: It is another update of C#9 known as ‘init accessor’, enabling you to define properties that can only be initialized. 

Universal UI

According to the official documentation of .NET 5, developers can now build interfaces for all types of platforms including iOS, Android, Windows in a single project. This universal UI is also known as .NET Multi-platform App UI or NET MAUI. It is called an evolution of Xamarin.forms, but it is a universal model to design UIs for both mobile and desktop applications. It also supports the following patterns;

MVU is a one-way data flow pattern influenced by Elm programming language infrastructure to handle UI updates and application state. 

Embracing Single-File Applications

In this version of .NET 5, developers will experience the single-file applications feature. It means that developers can now publish or employ applications, and all of its dependencies in a single file, i.e. all the dependencies are bundled into a single file. This feature is different from .NET 3.1 single-file applications, where it was allowed to package binaries only. The single-file applications feature in .NET 5 contains a new internal structure, supporting direct execution while carrying no pressure on performance. 

Removal of a Few Technologies

The main objective of .NET 5 is to build a version that can support cross-platform programming versions, meaning that it has to remove some technologies that were present in the previous version such as;

  • Web Forms: .NET 5 is no longer supporting Web Forms. Nevertheless, alternatives like Razor Pages and Blazor can be used to build traditional web applications and single page applications respectively. 
  • WCF: Although it’s a bit shocking news for developers that .NET 5 is also not supporting Windows Communication Foundation or WCF, it’s now offering gRPC migration instead of WCF. 
  • Windows Workflow Foundation: .NET framework has planned to remove windows workflow foundation in its latest version. But developers can try CoreWF to move existing workflows or to build new ones. 

By now, you’ve finally gained an idea about opportunities, amendments and technology alternatives available in .NET 5. If you want to know more about .NET 5 amendments, check out the official documentation or try .NET 5 right now by installing a software development kit.

Let’s build your dream together.