Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing the default c# console application template code in visual studio 2022

When creating a console application project for .net 6.0 c# in visual studio, it generates the following code:

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

As opposed to previous c# versions, where the project template created some useful boilerplate, non of this is helpful whatsoever.

Is it possible to configure visual studio 2022 so that when creating console applications for c# in .net 6.0 the file will be completely empty?

like image 589
Yuval Amir Avatar asked Nov 27 '25 02:11

Yuval Amir


1 Answers

Apparently, when creating a new solution, one has to select the "Do not use top-level statements" checkbox when selecting the .Net version, on the last step of the solution creation. Not exactly by default, but at least there is that option.

like image 108
nowave7 Avatar answered Nov 29 '25 14:11

nowave7