Home > other >  How can I disable Top-level statements when using `dotnet new console`?
How can I disable Top-level statements when using `dotnet new console`?

Time:01-27

I created a C# project with the below command in VSCode and enabled Top-level statements automatically for this project. How can I disable Top-level statements in Visual Studio Code for a C# project?

dotnet new console --framework net7.0

CodePudding user response:

Add --use-program-main. See the documentation for details.

  • Related