visual-studioconsole-applicationvisual-studio-2022

How can .Net 6.0 console app template create the old program style


Using .Net 6.0, when we create a C# project with the Console app template we get only this:

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

There is a way to get back to the old program style, it requires a different framework: https://learn.microsoft.com/en-us/dotnet/core/tutorials/top-level-templates#use-the-old-program-style. Well, guess what? I can't change the framework.

Is there an easier way to get the old template back while still using .Net 6.0?

Editorial: please go here and vote against this (stupid) new template: https://github.com/dotnet/docs/issues/27420


Solution

  • You should see a checkbox on the third step (1 = Create a new project / 2 = Configure your new project / 3 = Additional information).

    Create console application - additional information

    You might try and update the dotnet templates using

    dotnet new --update-check
    dotnet new --update-apply