Complete VS Code Set up for .NET and C# Programming

Visual Studio Code is one of the most popular code editors among developers today. It’s customizable, lightweight, and familiar to many programmers. My opinion is that VS Code is an excellent choice for coding C# and .NET

In this article, I’ll walk you through how I set up my VS Code environment for .NET and C# coding πŸš€πŸ™Œ.

1) Download and Install VS Code ⬇️:

Link πŸ”—: https://code.visualstudio.com/download

After downloading the VS Code setup from the above link, you can easily install it directly.

2) Install relevant extensions for .NET and C# ⬇️ :

Open VS Code on your PC or laptop and navigate to the extensions section using the sidebar. At the top of the extensions search for below names

  • C# Dev kit: helps you manage your code with a solution explorer and enhance your C# environment

  • Intellicode for C# Dev kit: provides AI-assisted development features for C#

Check whether it automatically installs .NET install Tools and C# for Visual Studio Code extensions.

If these are okay, you’re ready to go. πŸƒβ€β™‚οΈ

3) Download and install .NET SDK ⬇️:

Download the .NET SDK that matches to user device OS and install it.

Link πŸ”—: https://dotnet.microsoft.com/en-us/download/dotnet/9.0

Check whether .NET is installed on your PC correctly.

  • STEP-1: Open the command prompt on your pc

  • STEP-2: Type dotnet β€”version

  • STEP-3: Press Enter

If it’s showing the version, Congratulations! πŸ₯³ .NET has been correctly installed on your system.

4) Create a console project πŸ™Œ:

  • STEP-1: Create a new folder on your pc where you want

  • STEP-2: Open VS Code on that folder location

  • STEP-3: Open a new terminal on VS Code by clicking Ctrl + Shift + ` or using the top bar

  • STEP-4: Enter the code below on your terminal

      dotnet new console -o ./projectName
    

    Now you’re ready to go. πŸƒβ€β™‚οΈ

5) Write the first code πŸ§‘β€πŸ’»:

Now you can see the file structure of the project. Open Program.cs file and type whatever C# code you want.

6) Run C# Code πŸ‘:

You can run your code using the VS Code run button that shows at the top of the file, or simply by typing dotnet run In your terminal.

Thank you for reading πŸ§ πŸ‘

Congratulations!πŸ₯³ Now you are completely ready for code C# on your VS Code. Happy Coding!

Best regards!

Chathush-Vishmika

0
Subscribe to my newsletter

Read articles from Chathush Vishmika directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Chathush Vishmika
Chathush Vishmika

Sharing my journey as I learn web development from scratch. Writing to learn, grow, and help other beginners along the way. πŸ‘¨β€πŸ’»πŸ“˜