This topic describes how to develop a .NET project by using Visual Studio Code (VS Code) on Windows.
Step 1: Install VS Code
Visit the official website of VS Code and click Download for Windows to download the installation file.
Double-click the downloaded file such as VSCodeUserSetup-x64-1.89.1.exe and use the installation wizard to install VS Code.
ImportantIn the Select Additional Tasks step, you must select Add to PATH (requires shell restart).
Step 2: Create a. NET project
Open VS Code, and click Extensions in the left-side navigation pane or press
Ctrl+Shift+X
. In the EXTENSIONS panel, search for and install the following plug-ins:C#: provides features such as IntelliSense, code navigation, debugging, code formatting, and refactoring. You can use the C# plug-in to manage .NET projects and NuGet packages. The C# plug-in seamlessly integrates .NET development processes and is a necessary tool for C# developers to improve coding efficiency.
.NET Install Tool: allows you to configure the C# development environment with ease and run the
dotnet
command to create, run, and build .NET core projects in VS Code. This simplifies the development process and improves the development efficiency.
In the top navigation bar, choose File > Open Folder to select a folder in which you want to create a .NET project. Run the
dotnet new console -n FirstDotnetProject
command in VS Code to create a project.Run the project in the
FirstDotnetProject
folder and run thedotnet run
command in VS Code. IfHello, World!
is returned, the environment is built.
Step 3: Install dependencies
You can run the dotnet add package <package-name>
command to install dependencies. For example, you can run the following command to install the ECS SDK dependency:
dotnet add package AlibabaCloud.SDK.Ecs20140526