Visual Studio Code

C# Dev Kit

C# Dev Kit is a Visual Studio Code extension made by Microsoft that adds full C# support to the editor. Without it, VS Code has no understanding of C# — with it, you get the tools you need to write, run, and debug C# programs.

What it adds#

Installing C# Dev Kit gives VS Code three things it doesn’t have by default for C#:

Intelligent autocomplete — as you type, VS Code suggests completions based on the C# language and your project’s code. It shows available methods, properties, and variables so you don’t have to remember everything.

Create a C# Project in Visual Studio Code

This procedure walks you through creating a new C# console project in Visual Studio Code using the C# Dev Kit extension.

Prerequisites#

Steps#

  1. Open Visual Studio Code.
  2. Open the Explorer panel by clicking the file icon in the left sidebar.
  3. Click Open Folder and choose a folder for your project, or create a new one.
  4. Open the Command Palette with Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac).
  5. Type .NET: New Project and select it from the list.
  6. Select Console App from the project templates.
  7. Enter a name for your project and press Enter.
  8. Confirm the folder where the project will be created and press Enter.
  9. When prompted for the solution file format, select .sln and press Enter.

Result#

Your project folder will contain:

Integrated Development Environment (IDE)

An Integrated Development Environment (IDE) is an application that brings together everything you need to write, organise, and run programs — in one place.

┌─────────────────────────────────────┐
│               IDE                   │
│  ┌──────────┐      ┌─────────────┐  │
│  │   File   │      │   Editor    │  │
│  │ Explorer │      │             │  │
│  └──────────┘      └─────────────┘  │
│  ┌───────────────────────────────┐  │
│  │          Terminal             │  │
│  └───────────────────────────────┘  │
└─────────────────────────────────────┘

The editor#

The editor is where you write your code. It looks like a text editor, but it understands the programming language you’re working in. That understanding powers three features that make a real difference when you’re starting out:

Run a C# Project in Visual Studio Code

This procedure walks you through running a C# console program in Visual Studio Code using the terminal.

Prerequisites#

Steps#

  1. Open Visual Studio Code with your project folder open.
  2. Open the built-in terminal with Ctrl+\`` (Windows/Linux) or Cmd+`` (Mac). You can also go to View → Terminal.
  3. Make sure the terminal is in your project folder — you should see the folder name in the terminal prompt. If not, navigate to it with cd folder-name.
  4. Save any unsaved changes with Ctrl+S (Windows/Linux) or Cmd+S (Mac).
  5. Run the program with:
dotnet run

Result#

The program builds and runs. Its output appears in the terminal directly below the dotnet run command.

Visual Studio Code

Visual Studio Code (VS Code) is a free, lightweight code editor made by Microsoft. It supports almost every programming language and runs on Windows, macOS, and Linux.

What it includes out of the box#

VS Code comes with the core features you’d expect from any IDE — a code editor with syntax highlighting, a file explorer, an integrated terminal, and Git support. It handles the basics well for most languages without any extra setup.