Use vs code to develop and debug. NET core RC2 applications, because. NET core is currently in preview.
This article uses the examples provided by Microsoft to develop and debug.
Https://github.com/aspnet/cli-samples
Introduction and description of. NET Core:
Https://github.com/dotnet/cli
http://dotnet.github.io/getting-started/
Environment installation
The actual environment developed in this paper: Win10 x64 Vscode 1.0
Download
Https://github.com/dotnet/cli#installers-and-binaries
. NET Core SDK Installer:
Https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/Latest/dotnet-dev-win-x64.latest.exe
Vscode:
https://code.visualstudio.com/
Vscode C # Plugins:
Https://github.com/OmniSharp/omnisharp-vscode/releases
Latest Version: Https://github.com/OmniSharp/omnisharp-vscode/releases/download/v1.0.4-rc2/csharp-1.0.4-rc2.vsix
After installing Vscode, open Vscode to install the C # plug-in.
Install plug-in: directly with Vscode to open the plugin file can be installed.
After installation, F1 will find a lot of dotnet command, proof of installation is complete.
Development and commissioning
Download Microsoft Sample code: Https://github.com/aspnet/cli-samples
After downloading the code, open the folder with Vscode Cli-samples/hellomvc
F1 Input dotnet Restore
Select the corresponding dotnet Restor (this shows a bug like a plugin)
You can also open the command line directly in the folder, and you can also restore the relevant references by entering Dotnet restore.
After we have restored the relevant references, we are ready to debug.
Click on the debug program and run up.
This allows you to debug the breakpoint.
Visit http://localhost:5000/
Development
Let's add a new action
[HttpGet ("/about")] Public Iactionresult About () { var useragent=request.headers["User-agent"]; Return Content (useragent+ "\r\nabout by Linezero"); }
Visit: Http://localhost:5000/about
Click the breakpoint to debug the program, the breakpoint set is the same as vs.
After the break, you can view the corresponding properties and values.
There is a corresponding monitor on the left to see each value.
This way we can already debug. NET Core.
If you think this article is helpful to you, please click " recommend ", thank you.
Category:. NET Core
VS code Development Debug. NET Core