This procedure walks you through creating a C# console project in Visual Studio Code using the C# Dev Kit extension.
🧰 Prerequisites
Install all three before continuing. The steps below assume they are already set up.
- Visual Studio Code installed
- .NET SDK installed
- C# Dev Kit extension installed
📋 Steps
You need to complete the procedure in one go. Check all the steps first.
-
Open Visual Studio Code.
-
Open the Command Palette with
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(Mac). -
Type
.NET: New Projectand select it from the list. -
Type
Console Appand select it from the project templates list. -
Create or select an existing folder.
Only appears if a project folder is not open.
-
Enter a name for the project and press
Enter. -
Confirm the folder where the project will be created and press
Enter.
If prompted for the solution file format, select
.slnxand pressEnter.
🎯 Expected Outcome
The project folder will contain:
- A
Program.csfile withConsole.WriteLine("Hello, World!"). - A
<ProjectName>.csprojfile.
⚠️ Mistakes
Not completing the procedure in one go
The .NET: New Project wizard runs as a sequence of prompts in the Command Palette. Closing it at any point, by pressing Escape or clicking away, resets the wizard and no files are created. Start from step 3 again and work through all the prompts without interruption.
Choosing the wrong project template
Select Console App, not Class Library, ASP.NET Core Web App, or any other template. The other templates produce different project structures with different entry points. If you chose the wrong one, delete the generated files and start from step 3.