9

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

 3 years ago
source link: https://anthonygiretti.com/2021/01/24/net-5-how-to-enable-net-5-runtime-on-console-apps-instead-of-net-core-3-1/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

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

2021-01-24 by anthonygiretti

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 🙂

Like this:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK