

.NET 5: How to enable .NET 5 runtime on console apps instead of .NET Core 3.1 ?
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.

.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
Like this:
Recommend
-
16
.Net Core Console DI, HttpClientFactory and Serilog I needed to create a .Net Core 3.0 console app that makes HTTP calls and log results to a text file. It took me awhile and I used a few resources, so I’m creating this article for f...
-
3
Introduction Suppose you have been using ASP.NET MVC version 5.x for quite some time now and started to understand ASP.NET Core. In that case, I tell you you’re doing an excellent job because you’re upgrading your...
-
8
-
2
Jimmy Byrd on Twitter: "MiniScaffold 0.29.0 is out! It removes the fake-cli runner and uses a dotnet console project to run the build instead. It still makes uses all of FAKE's libraries. https://t.co/ntATyy6XkD #fsharp #dotnet #dotnetcore"...
-
17
其實我們這幾年幾乎都在用前後端分離的架構在開發網站,單純使用 ASP.NET Core MVC 的機會並不多,但是我知道很多人還是在用 MVC 在維護網站,而且 ASP.NET Core 預設會將所有 Razor 頁面 (Views) 編譯成 DLL 檔,網站啟動之後如果要修改 View 的內容,還需要重...
-
8
Introduction Suppose you have been using ASP.NET MVC version 5.x for quite some time now and started to understand ASP.NET Core. In that case, I tell you you’re doing an excellent job because you’re upgrading your...
-
4
Logging in .NET Core Console Applications Published by vainolo on 2021-05-11 Last updated on 2021-10-12 ...
-
8
Running .NET Console Apps in Azure Container InstancesThis website uses cookies to ensure you get the best experience on our website. Learn more
-
8
Why JavaScript Developers Should Use the Debugger Instead of Console.logWhy JavaScript Developers Should Use the Debugger Instead of Console.log
-
2
Enable Un-typed within ASP.NET Core OData Sam Xu
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK