VSC Debugging. NET Core Applications

Source: Internet
Author: User
Tags dotnet windows x64

VS Code develops and debugs a. NET Core application from scratch

Use vs Code to develop and debug. NET Core applications from scratch, C # debugging.

The previous article using vs code to develop debugging. NET Core applications was supported by everyone.

Now bring you a zero-starting tutorial that will give you a better understanding of the. NET Core application. Use vs Code to develop C # programs and debug programs.

And it will solve some of the problems left over from the last article.

Environment installation

The actual environment developed in this paper: Win10 x64 Vscode 1.0

Download

. 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

Installing the C # plug-in

The previous comment area has many friends who appear Omnisharp server is not running.

The main reason for this is that the OMNISHARP Server section is not downloaded.

It is best to install the agent here all the way, to ensure that omnisharp completely downloaded.

If everyone does not have a proxy, I will encapsulate a C # plugin based on Omnisharp's latest version of the package.

It can be used directly after installation and no more OMNISHARP server is not running.

Heavy Recommendation: Click Download ( password: Caon) Note : This plugin only applies to Windows x64 system, other systems please download the official plugin.

Install plug-in: directly with Vscode to open the plugin file can be installed.

After the installation is restarted, it appears as shown on behalf of the plug-in installation succeeded.

Create a project

1. Create a new folder Netcoredemo

2. Create Project dotnet New

3. New Nuget.config

Create a new Nuget.config to copy the contents below.

<?xml version= "1.0" encoding= "Utf-8"?><configuration>  <packageSources>    <clear/>    <add key= "Aspnetci" value= "Https://www.myget.org/F/aspnetcirelease/api/v3/index.json"/>    <add key= "nuget.org" value= "Https://api.nuget.org/v3/index.json"/>  </packagesources></configuration >

4. Open Netcoredemo with Vscode

Open the Netcoredemo folder and there will be an elevation click Yes.

Opening the project for the first time will result in some errors, automatically generating Launch.json for you, and allowing you to automatically revert related references.

Here to make a little change in Project.json.

  "Dependencies": {    "Microsoft.NETCore.App": {"      type": "Platform",      "version": "1.0.0-rc2-*"    }  },

Change MICROSOFT.NETCORE.APP version to 1.0.0-rc2-*

After you change F1 dotnet restore, restore the reference once again.

Configuring debugging

1. Commissioning

Click Debug, you will find that can not be debugged, breakpoints can not be broken down.

Here we need to make a configuration.

Open Project.json File on node: Compilationoptions join:"debugType": "portable"

"Compilationoptions": {    "debugtype": "Portable"},

Edit to save later, reopen Vscode.

Then click Debug, found that the breakpoint can be broken down, view parameters and other operations can be normal.

2. Development

Smart tips provide powerful support.

This allows us to develop. NET core programs while using Vscode to debug. NET core programs.

If you think this article is helpful to you, please click " recommend ", thank you.

Category:. NET Core

VSC Debugging. NET Core Applications

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.