SHARE:

.NET 5: How to enable .NET 5 runtime on console apps instead of .NET Core 3.1 ?

Introduction

You may have noticed it already, but when you create a console application with Visual Studio 2019, the default runtime is not .NET 5 but .NET Core 3.1! Why ? Because .NET 5 is not LTS and therefore Microsoft has intentionally chosen to offer the latest LTS version of .NET by default, ie .NET Core 3.1.
In this article I show you how to select .NET 5 instead of .NET Core 3.1 without having to create a console application in .NET Core 3.1 and then change its runtime in the project properties afterwards.

Enabling all .NET Core templates

This is the hidden features ! Enable that options here: Tools > Options > Preview Features > “Show all .NET Core templates in the New project dialog (requires restart)”

This will unlock the possibility to enable .NET 5 on console apps, after selecting console app here:

Visual Studio 2019 will ask you to choose between .NET Core 2.1 (LTS), .NET Core 3.1 (LTS) and .NET 5:

That’s it 🙂

Written by

anthonygiretti

Anthony is a specialist in Web technologies (14 years of experience), in particular Microsoft .NET and learns the Cloud Azure platform. He has received twice the Microsoft MVP award and he is also certified Microsoft MCSD and Azure Fundamentals.