If you want to Use the old program style
,
- Create a new project dotnet new console --framework net5.0
- Open the project file in a text editor and change
<TargetFramework>net5.0</TargetFramework>
to<TargetFramework>net6.0</TargetFramework>
- Open the project file in a text editor and change
More Information:
https://learn.microsoft.com/nl-nl/dotnet/core/tutorials/top-level-templates#use-the-old-program-style
If you prefer to use Visual Studio, Create a new Console Application.
Choose Target Framework as .NET 5:
And then if you want to use all the nice C# 10 and .NET 6 features, update the csproj file as above.