
To install C# in VS code you need to follow 5 main steps, to download .net SDK, and VSCode extensions.
Table of Contents
Download and install .net SDK
go to dotnet.microsoft.com/en-us/download and download the latest version of the .net for your operating systems.

Download and Install VSCode
Now you need to download and install VS Code
Download Visual Studio Code – Mac, Linux, Windows

Install C# in VSCode Extensions
In order to Run C# in VSCode you need to install two main extension to enable .net projects and C# code inside VSCode.
Goto Extensions tab in VS code and search for following two extensions and click install
a. C# dev Kit

b. IntelliCode for C# Dev Kit

a bonus tip! also search and install VS Code extension called “Code Runner”. This is a very handy extension, that allows us to run code directly by clicking the Run Button.

Check installation
open command prompt or Terminal and type the following command to check if the .net SDK is properly installed and running.
dotnet --version
Once you run the command, you should see the .net sdk version number as bellow.

Create C# .net project in VS Code
First, you need to create an empty folder on your drive and open that folder inside VSCode. Goto File, click open folder and select your project folder.
- Now, Goto the View Menu and select “Command Palette…” option from it.

2. Now in Palette type “.net: new Project” and select the new project window.

3. As soon as you select the “.net New Project” option, a new option panel would appear. Type Console and Select “Console App” from this Option

4. After this a new pallete would apear, asking to enter the Name of the New Project. Type Your Project Name here and Press Enter.

5. Once you provide the project, now select the folder to save the project, which in our case will be the “Default directory” and press ENTER

6. Finally it again going to confirm to “Create Project”, select this option and press ENTER

All DONE. Now you will notice that VS Code has create the New Project and all necessary library files are automatically added to your project folder.

Run C# Code in VS Code
To run C# code, locate and open the “program.cs” file in the root of yoru newly created project director in VS Code Explorer.
Then Click on the Run ▶️ Button on the top right corner the vscode as shown.

Now in Terminal Window type the following command to run the Project
dotnet run

CONGRATULATIONS! You have successfully installed and Run C# .net SDK in VS Code.
HAPPY Coding.