How To Setup Visual Studio Code For C# 10 And .Net 6.0

Introduction

In this article, we are going to discuss How to set up Visual Studio Code so that we can use C# 10 and .Net 6 with vscode.

This is a step by step guide for beginners, intermediate and experienced programmers to setup environment and create .net application using Visual Studio Code + C# 10 and .net 6.0

Let’s start with installation,

We need to install .net 6.0 SDK first,

STEP 1 - Download .net 6 SDK from the official Microsoft site here.

Setup Visual Studio Code for C#10 and .net 6.0

STEP 2 - Click on the Runtime link based on your operating system.

Setup Visual Studio Code for C#10 and .net 6.0

Setup file would be downloaded in your download folder,

Setup Visual Studio Code for C#10 and .net 6.0

STEP 3 - Double click on the .exe file and complete installation.

Setup Visual Studio Code for C#10 and .net 6.0

STEP 4 - Let's check the version installed in your system using the below command.

dotnet --info

Setup Visual Studio Code for C#10 and .net 6.0

Nice, now .net 6 SDK is installed successfully in your system. Now we will install VSCode from the Microsoft site.

STEP 5 - Install Visual studio code from here 

Setup Visual Studio Code for C#10 and .net 6.0

STEP 6 - Complete installation based on your operating system.

Setup Visual Studio Code for C#10 and .net 6.0

Once completed click on the finish in the below screen.

Setup Visual Studio Code for C#10 and .net 6.0

Now we will install C#,

STEP 7 - Install C# from here 

Setup Visual Studio Code for C#10 and .net 6.0

STEP 8 - Search C# and Install.

Setup Visual Studio Code for C#10 and .net 6.0

Once installed below popup appears.

Setup Visual Studio Code for C#10 and .net 6.0

STEP 9 - Another way to install C# is to search in Visual Studio Code -> Extension and install.

Setup Visual Studio Code for C#10 and .net 6.0

Once C# is installed, our environment is ready to use. Now we can create a new dotnet project using Visual Studio Code + .net 6 and C# 10.

Let’s create dotnet project,

STEP 9 - Create workspace/folder. I have created Demo folder/workspace.

Setup Visual Studio Code for C#10 and .net 6.0

STEP 10 - Open Visual Studio Code -> File -> Open Folder.

Setup Visual Studio Code for C#10 and .net 6.0

STEP 11 - Open terminal -> New Terminal.

Setup Visual Studio Code for C#10 and .net 6.0

STEP 12 - Create a new console project using the below command,

dotnet new console

Setup Visual Studio Code for C#10 and .net 6.0

STEP 13 - Open Demo folder and check project.

STEP 14 - Check Visual Studio Code -> Demo project

Setup Visual Studio Code for C#10 and .net 6.0

STEP 15 - Double click on Demo.csproj file and check target framework.

Setup Visual Studio Code for C#10 and .net 6.0

STEP 16 - Run the Console application using the below command.

dotnet run

Setup Visual Studio Code for C#10 and .net 6.0

Summary

We have set up Visual Studio Code to work with C# 10 and .net 6.0. That’s all for this article. Hope you enjoy it and find it useful.


Recommended Free Ebook
Similar Articles