Create a C# Project in Visual Studio Code

In this tutorial, you will create a simple C# project in Visual Studio Code using the C# Dev Kit extension.


Step-by-Step Instructions#

  1. Download and Install Visual Studio Code (external link) if you have not done so already.
  2. Open Visual Studio Code.
  3. Install the C# Dev Kit (external link) extension.
    • Open the Extensions panel on the left sidebar.
    • Search for C# Dev Kit and click Install.
  4. Open the File Explorer panel.
  5. Select Open Folder.
  6. Choose an existing folder or create a new one for your project.
  7. Open the Command Palette by pressing Ctrl+Shift+P
  8. Run the command .NET: New Project....
  9. Select a project template, for example: Console App.
  10. Enter the project name.
  11. Press Enter to create the project in the selected folder.
  12. Select the solution file format: .sln.
  13. Press Enter to create the project.
  14. Open the file Program.cs file to start coding.

After completing these steps, your project folder will contain:

  • Program.cs - the main file where you write your code
  • <ProjectName>.csproj - the C# project file
  • <SolutionName>.sln - the solution file

Visual Studio Code creates these files automatically when you create a new project.

Resources#