Introduction
Visual Studio Code (VS Code) is a source code editor developed by Microsoft. It is most popular with several developers and educational institutions around the world and it can be used for varieties of programming languages for instance, C, C#, C++, Java, Go, JavaScript, Python, Node.js, rust, and many more. These days VS code is getting more popular. It is a handy IDE for developing applications of any platform as well as it is open source and completely free for any kind of development. We can get several extensions and packages to develop applications in several languages inside it. Additionally, it is lightweight in comparison to Visual Studio.
This article describes the full utilization of Visual Studio code for .NET development. Additionally, the article demonstrates how to create a console app, class library project, solution, and ASP.NET Core 7 application with an example.
This article will cover:
- What are the things needed for .NET development in VS Code
- Getting Started with Console app, class library project, solution creation, and ASP.NET MVC app creation using VS code with sample example.
Prerequisites
- Visual Studio Code
- .NET 7 SDK and C# extension to be installed
Create a Solution using VS Code
Step 1
Open VS code and open the folder where you want to create a project. From the main menu select File-> Open Folder
Step 2
Open the Terminal by selecting View then go to Terminal from the menu or(Ctrl+Shift+P) or simply click on the terminal. Then the terminal opens with the command prompt with the folder name.
Step 3
Run the below command to create a solution in the terminal
dotnet new sln
The solution will be created as shown below with the name of the folder.

Now, we will create a Class Library project.
Create a Class library project
Step 1
In the terminal, you need to run the below command to create a class library project.
dotnet new classlib -o YourClassLibraryprojectname
Below is an example of creating a HelloWorld class library project.
dotnet new classlib -o HelloWorld
It will create a class library project with the name HelloWorld.

Step 2 - Add class lib project to the solution
Run the below command to add the class lib project to the solution.
dotnet sln add YourClassLibraryprojectname/YourClassLibraryprojectname.csproj
dotnet sln add HelloWorld/HelloWorld.csproj

The default Project structure will be like below.








Rama DabburiPosted Feb 6, 2023, 1:23 PM
Can we use VS code, for every thing that can be done in Visual Studio Proffesional