Skip to content

Create project dotnet

Context: Use dotnet new console with the -n parameter to create a new console app. The project targets .NET 10 by default.

Use dotnet new console with the -n parameter to create a new console application.

Terminal window
dotnet new console -n HelloWorld
Terminal window
HelloWorld/
├── HelloWorld.csproj
├── Program.cs
└── obj/
Terminal window
cd HelloWorld
ls -la
# View the project file
cat HelloWorld.csproj
# View the initial Program.cs
cat Program.cs

Initial Program.cs (with top-level statements)

Section titled “Initial Program.cs (with top-level statements)”
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");