VS code Development Debug. NET Core

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.