Use VS Code for development and debugging. NET Core 2.0,. netcore
Use VS Code to develop and Debug. NET Core 2.0 from scratch. You can develop and debug a. NET Core 2017 application without installing VS 15.3 2.0 +.
Visual Studio Code is short for Visual Studio Code. Visual Studio Code is a lightweight cross-platform Web integrated development environment that can run on Linux, Mac, and Windows!
This article is the VS Code development and debugging. NET Core 2.0 tutorial. It does practical operations in Windows, but also applies to other systems.
Environment Installation
This article demonstrates the development environment: WIN10 x64 Visual Studio Code 1.15.1
. NET Core sdks 2.0 Windows x64 Installer:
Https://aka.ms/dotnet-sdk-2.0.0-win-gs-x64
If the SDK has been installed in a previous version, we recommend that you uninstall it before installing it.
Download more system versions:
Https://www.microsoft.com/net/download/core
VSCode:
Https://code.visualstudio.com/
VSCode C # Plug-in:
Open extension search C # and select C # installation.
Restart VS Code after installing the plug-in.
Create a project
First, ensure that the. NET Core SDK is installed successfully.
Dotnet -- version
The output is as follows:
2.0.0
Then you can create a project.
Dotnet new console
Dotnet run
The entire command execution is complete. . NET Core 2.0 SDK dotnet restore is executed by default.
Use VS Code for development
Use VS Code to open the core2.0 folder and open the Program. cs file.
If the plug-in is enabled for the first time, you need to wait patiently for the plug-in installation. The installation is successful, for example:
Wait a moment, as shown in.
Select Yes. The plug-in automatically configures launch. json for us.
Then we can switch to the debugging window for debugging and click the debug button.
The next breakpoint is successfully disconnected.
F10 skip F11 one-step debugging F5 execution in one step.
You can also select additional debugging as follows:
Add ReadKey () to the code and run it on the terminal dotnet
Click the debug button and select dotnet exec
Then the terminal can enter any key to continue, and the program can also perform debugging normally.
You can easily write code. The plug-in provides us with the smart prompt function. In this way, you can develop. NET Core 2017 without installing VS 15.3 2.0 +.
Here we recommend a NuGet plug-in.NuGet Package Manager allows you to conveniently add packages. For example:
If you think this article is helpful to you, click"Recommendation", Thank you.