.NET 5 has reached End of Life
Tags: csharp, dotnet, beginners, news
Published: 2022-05-05 08:36:00

In recent years, especially with the pandemic, everything has been moving very fast. The release of .NET 5 by Microsoft was only a year and a half ago (specifically on November 10, 2020) and we have to say goodbye to it.

Sadly, Microsoft’s deadline for developers to migrate to .NET 6 is ending and **support for .NET 5 ends on [May 10, 2022](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core)** (yes, in a couple of days).

![.NET Supported versions (Source: Microsoft)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9iqldbtm2z9rt9yqr3d7.png)

On the bright side, the new version of the Framework: .NET 6, will bring **LTS** (long term support) and according to Microsoft, it will last until the end of 2024.

---

## What will happen with .NET 5 projects?

One of the reasons why Microsoft is going to stop supporting .NET 5 (and other older versions) is because those versions must be signed with algorithms and currently they are signed with the [SHA-1 algorithm](https://www.encryptionconsulting.com/education-center/what-is-sha/). This algorithm has been vulnerable for some time and can affect from **document signing**, to **HTTPS certificates**, to **backup systems** and **Version Controls** (git).

As a curious fact, although this happened a couple of years ago, **Google managed to break this algorithm** by managing to have **[2 different PDF files with the same Hash](https://shattered.io/)**.

![Attack proof (Source: https://shattered.io/)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0cix9r8z2um2tgklkapx.png)

At first nothing will happen, but you will no longer receive security updates and support from Microsft. It is not the end of .NET 5 because this date simply refers to updates, patches, technical support or security fixes but this could leave many applications exposed to new (and not so new) vulnerabilities.

That is why any developer who has projects in .NET 3.1 or .NET 5, **should migrate them to .NET 6** in order to continue receiving all the updates and support from Microsoft.

---

## What does .NET 6 bring?

The most expected from Microsoft, which has been trying to achieve this for years, is to make .NET a unified platform. And now [according to Microsoft](https://devblogs.microsoft.com/dotnet/announcing-net-6/#net-6-highlights), .NET 6 will bring:

> "Unified platform across browser, cloud, desktop, IoT, and mobile apps, all using the same .NET Libraries and the ability to share code easily."

![Unified and extended platform (Source: Microsoft)
](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/20ucsz3ek8qsorsuqq3k.png)

In addition, the console app project template is [reduced to just 1 line](https://docs.microsoft.com/en-us/dotnet/core/tutorials/top-level-templates), which makes it easier to create small programs. In .NET 5 was:

```csharp
using System;
  namespace MyApp // Note: actual namespace depends on the project name.
 {
     internal class Program
     {
         static void Main(string[] args)
         {
             Console.WriteLine("Hello World!");
         }
     }
 }
```

And with the arrival of .NET 6, this is reduced to just 1 line of code:

```csharp
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
```

📚 **Featured:** You can learn more about console app template in the original Microsoft article: [.NET 6 C# console app template generates top-level statements](https://docs.microsoft.com/en-us/dotnet/core/tutorials/top-level-templates)

In addition, the new version 6 of the .NET Framework comes with a new language version: **C# 10** (although previews of C# 11 are already being released). This version comes with many new features:

- File-scoped namespace declaration
- Constant interpolated strings
- Extended Property Patterns

and more (you can check this article):

{% link https://dev.to/dotnetsafer/the-6-features-of-c-10-you-need-to-know-now-oja %}

Not only that, but it also comes with the new version of its IDE: **Visual Studio 2022**. This new version of Visual Studio brings great news, now its **64-bit version is available**. This means that the main process devenv.exe no longer has the limitation it had in the 32-bit version (**4GB** in memory).

Microsoft showed [how this new version is capable of loading a solution of more than 300,000 files](https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes).

![Visual Studio 2022 64-bit(Source: Microsoft)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k0ypz7ffv2vlxvjbf9lx.gif)

Let’s not forget **[Hot Reload](https://devblogs.microsoft.com/dotnet/update-on-net-hot-reload-progress-and-visual-studio-2022-highlights/)**, the feature that allows you to make changes to the debugging project without having to stop and start it again.

You can learn more about the features of Visual Studio 2022 in this article:

{% link https://dev.to/dotnetsafer/visual-studio-2022-is-here-5-features-that-you-will-love-3dh6 %}

---

## How to upgrade to .NET 6?

Microsoft strongly recommends upgrading applications to .NET 6 and for that purpose leaves this article on how to do it: **[Upgrading to .NET 6.0](https://devblogs.microsoft.com/dotnet/dotnet-5-end-of-support-update/#upgrading-to-net-6-0)**

After saying goodbye to .NET 5 and enjoying .NET 6, we are still waiting for all the news and updates from Microsoft about .NET 7. Will they surprise us? Who knows.