Search:

What's new in .NET 5.0

C#, F#, EF Core, Visual Studio, Porting and more.

What is new in DotNET 5.0

.NET community and Microsoft organized a great online conference announcement of .NET 5.0 and related products. .NET 5.0, C# 9, F# 5, EF Core 5.0, and many other major updates are released. If you missed the conference you can watch it on the YouTube channel of .NET or check out their development blog.

Why 5?

As you know the latest .NET framework version is 4.8 and the .NET Core version is 3.1. Microsoft thought that naming the next major version after .NET Core 3.1 with 4.x may cause some confusion with .NET Framework 4.x. They also didn’t use ‘Core’ to emphasize that this is the main implementation of .NET going forward.

Highlights

Many great improvements are released with .NET 5.0 and here are some highlights:

  • Performance improvements are on average around 20% over .NET Core 3.1
  • Better development and the diagnostic environment with Visual Studio 16.8.0
  • Porting analyzers
  • Improvements on syntax and performance with C# 9 and F# 5
  • Tested under heavy load on dot.net, Bing.com, and stackoverflow.com. (See Nick Craver”s tweet about StackOverflow’s performance change with .NET 5.0)
  • Support for Windows ARM64 and WebAssembly

Performance

.NET 5.0 has huge performance improvements. Stephen from Microsoft, published a great article about ‘Performance Improvements in .NET 5’ and speakers at the .NET Conference gave some hints about performance. The benchmarks show that .NET 5.0 has around 20% performance increases over .NET Core 3.1. The gRPC had great improvements too. According to Microsoft benchmarks, .NET 5 server performance is 60% faster than .NET Core 3.1. .NET 5 client performance is 230% faster than .NET Core 3.1.

  • +38% for plaintext response (TechEmpower)
  • +42% for JSON serialization (TechEmpower)
  • +20% for fortunes (TechEmpower)
  • Blazor WebAssembly is 3X faster than the previous release
  • Component virtualization and pre-rendering in Blazor significantly speeds up initial execution.
  • Startup time and RPS improvement with Tiered Compilation
  • +60% gRPC as server, +230 gRPC as client

gRPV implementation performance

Visual Studio 16.8.0

Visual Studio is the main development environment for .NET developers. And it is the best IDE that I know so far. Microsoft released a new version on November 10th, at .NET Conference. Visual Studio gives a better development experience with more compatible integrations, extended language support, better productivity tools, and more advanced debugging features.

You can get improved Git integration on this version like; list of your local repositories, single click switch between branch histories, and more. They released new features for .NET productivity. They add Roslyn analyzer for .NET 5.0 SDK, inline parameter hints, improved refactoring in .NET.

dotnet adoption

Scott Hunter said that there are 5 million .NET developers at .NET Conference. These developers make 2 million deployments to Linux from Visual Studio. As a .NET developer/consultant who is developing on Windows, I need a debugging environment on my machine before deploying to any Linux. This feature had arrived with the new version of Visual Studio. Now we can debug our code in WSL 2 using the Linux distro of our choice.

Pinnable Properties and Parallel Stacks are also introduced with the new version. Both are great features to improve developers debugging experience and code quality.

Containers

.NET on containers are becoming more popular every day, especially after the release of .NET Core versions. Microsoft team also encourages developers to use .NET on containers by inverting more resources on containerization. They are developing an open-source project named Project Tye and they reduced the size of Windows Server Core images.

Multi-Stage build cost with Ubuntu and Debian

Porting

Updates and upgrades can be a  headache for developers. It is a choice between comfort and improvement. I am definitely on the side of improvement rather than comfort. This time the .NET team tries to create comfort on our ports. You can create Dependency Diagrams in Visual Studio and run .NET Portability Analyzer to understand relations, dependency, and portability percentages. These tools give you a better understanding of how to port to .NET Core (or .NET Standard) from .NET Framework. You may find a detailed step by step guide for porting on Microsoft’s documentation.

EF Core 5.0

EF Core is one of the core libraries, especially if you use relational databases with your .NET projects. It is also updated at .NET Conference. EF Core 5.0 is released with 81 major improvements. I think simplified logging, many-to-many relationships, filtered include, and splitting queries are great new features that will help developers.

What is not in .NET 5.0

.NET Foundation doesn’t plan to support the components listed below in the following releases. They are working on a unified platform vision and they need to drop some older features/components on the way to update themselves with new technologies. They also simplified framework names in .NET 5.0 as ‘net5’. Their new version naming convention is as ‘newX.Y-OS’, X stands for the major version, Y stands for minor version and OS is the operating system.

Component

  • Replacement

AppDomains

  • AssemblyLoadContext

Remoting

  • named pipes
  • gRPC

WebForms

  • ASP.NET Blazor

WVF Server

  • gRPC
  • Open-source community project: https://github.com/CoreWCF/CoreWCF

WF

  • Open-source community project: https://github.com/UiPath/corewf

.NET 5 on AWS

AWS is one of the corporate sponsors of the .NET Foundation and serves many .NET applications. Therefore, they are keeping up with the latest changes on .NET. You can use most of the new features just released on AWS. Now with ARM64 support, you can use AWS Graviton 2 Processors on EC2 instances with .NET.

As I mentioned earlier, .NET 5 offers huge performance improvements in gRPC communication. AWS also announced gRPC support on Application Load Balancers at the end of October 2020. So you are able to create well-architected, high performing, load-balanced microservices on AWS with .NET 5.0.

Also, AWS SDK for .NET gets updated nearly every day to support the latest changes on .NET frameworks.

.NET 5.0 is Preparation for Unified Future of .NET Platform

dotnet Schedule

NET 5.0 is just another big release and the .NET Conference was really exciting for developers. But the .NET team doesn’t stop here. They already started to work on .NET 6.0 and here is their roadmap. They plan to release the next major version in November 2021. And as a minor reminder, .NET 5.0 is not an LTS (Long Term Support) version but 6.0 will be. I always support modernization with every stable version as this is the only way we can follow the newest and best technology.

Sources:

https://devblogs.microsoft.com/dotnet/announcing-net-5-0/

https://aws.amazon.com/blogs/developer/net-5-on-aws/

https://devblogs.microsoft.com/dotnet/net-5-0-launches-at-net-conf-november-10-12

https://devblogs.microsoft.com/visualstudio/visual-studio-2019-v16-8/

https://devblogs.microsoft.com/visualstudio/visual-studio-2019-v16-8-preview-3-1/

https://docs.microsoft.com/tr-tr/visualstudio/releases/2019/release-notes

https://docs.microsoft.com/en-us/dotnet/core/porting/

https://devblogs.microsoft.com/aspnet/grpc-performance-improvements-in-net-5/

Iren Saltali

İren Saltalı, ex-CTO and Co-founder of image4io, is currently working as .NET Consultant at Kloia.