All Products
Search
Document Center

Alibaba Cloud SDK:Build a .NET development environment on Windows

Last Updated:Sep 19, 2024

This topic describes how to develop a .NET project by using Visual Studio Code (VS Code) on Windows.

Step 1: Install VS Code

  1. Visit the official website of VS Code and click Download for Windows to download the installation file.

    222.png

  2. Double-click the downloaded file such as VSCodeUserSetup-x64-1.89.1.exe and use the installation wizard to install VS Code.

    Important

    In the Select Additional Tasks step, you must select Add to PATH (requires shell restart).

Step 2: Create a. NET project

  1. 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.

  2. 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.

  3. Run the project in the FirstDotnetProject folder and run the dotnet run command in VS Code. If Hello, World! is returned, the environment is built.

    image

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