Use VS Code to develop and Debug. NET Core 1.1 and. netcore from scratch
Use VS Code to develop and Debug. NET Core 1.1 from scratch. You can develop and debug a. NET Core 2017 application without installing VS 1.1 RC.
. NET Core 1.1 has been released for some time. The biggest change is that it is restored from project. json back to csproj.
Today, Microsoft released. NET Core SDK 1.0 RC4, which is very close to the RTM version.
For. NET Core 1.0, you can view the previous tutorial and use VS Code to develop and Debug. NET Core 1.0 from scratch.
This tutorial is for VS Code development. NET Core 1.1. It is a practical operation in windows, but it is also applicable to other systems.
Environment Installation
This article demonstrates the development environment: WIN10 x64 Visual Studio Code 1.9.0
. NET Core sdks 1.0 RC4 Windows x64 Installer:
Https://go.microsoft.com/fwlink? Linkid = 841686
If the SDK has been installed in a previous version, we recommend that you uninstall it before installing it.
Download more system versions:
Https://github.com/dotnet/core/blob/master/release-notes/rc4-download.md
VSCode:
Https://code.visualstudio.com/
VSCode C # Plug-in:
Ctrl + P Open Quick Open input: ext install csharp select C # installation.
Restart VS Code after installing the plug-in.
Major recommendation:
VS Code C # Plug-in offline version 1.6.2
Note: This plug-in is only applicable to Windows x64 systems. For other systems, use ext install csharp to download the official plug-in.
Create a project
First, ensure that the. NET Core SDK is installed successfully.
Dotnet -- version
The output is as follows:
1.0.0-rc4-004771
Then you can create a project.
Dotnet new console
Dotnet restore
Dotnet run
The entire command execution is complete.
The latest SDK RC4 is changedDotnet newCommand.
By default, dotnet new no longer creates console applications, but displays help, and displays different help information based on the content of the current directory.
Empty folder:
Project Folder:
Use VS Code for development
Use VS Code to open the core11 folder, open the Program. cs file, and wait a moment, as shown in.
Select Yes. The plug-in automatically configures launch. json for us.
Note:
If you use ext install csharp to install the C # plug-in, wait patiently for the first time you open the plug-in.
Because you need to configure. NET Core Debugger and download OmniSharp server.
If the OmniSharp server is not running, it is because the OmniSharp server has not been downloaded.
A smart prompt and a prompt for adding a configuration file are displayed only after successful installation.
Then we can switch to the debugging window for debugging.
The next breakpoint is successfully disconnected.
We can also easily write code, and the plug-in provides us with a smart reminder function.
In this way, we can develop. NET Core 2017 without installing VS 1.1.
If you think this article is helpful to you, click"Recommendation", Thank you.