Configure. NET Core Debugger

Source: Internet
Author: User
Tags dotnet

Original address

https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger.md# Instructions-for-setting-up-the-net-core-debugger---Experimental-preview

Pre-demand/need-to-know/Miscellaneous
    • Requires a . NET Core rc3-23829 or an updated version. Everyday. NET core development can be supported from NuGet components. The following is the address of the component. Https://www.myget.org/F/dotnet-core/api/v3/index.json
    • X64 only
    • Support for Windows, OSX and Ubuntu 14.04
    • If you press F5 and the error appears, " No task runner Configured-tasks.json could not be found", see the following section.
    • If you do not have mono installed, you will not gain IntelliSense functionality.

First Run Configuration

First, download the Visual Studio Code https://code.visualstudio.com/

First, install the CLI http://dotnet.github.io/getting-started

Second, after the installation of Vscode, there is no C # language. So you need to install C #.

! Open the Vscode command line (F1);

! Enter "ext Install C #"

! Click install button to install after search

! Restart as prompted

Third, after the expansion installation, open any C # file with Vscode. At this point, the process is triggered to obtain the required files. Just wait for the process to complete

Iv. installation of Mono (LINUX/OSX)

! To be able to automatically create a Tasks.json file for each project, you now need mono. This step can be omitted, but you will need to add the file manually later.

! The following guidelines will show you how to install mono. Http://www.mono-project.com/docs/getting-started/install/Make sure that you install a version that is not less than 4.0.1.

For each project

The following steps must be performed for each project.

L First, change your file Project.json to refer to "netstandard.library (NET Standard library)": "1.0.0-rc3-*"

N Currently, the version referenced by the project file (Project.json) created by Donet New is too old. You should revise it.

n then run the dotnet Restore command. You can press the hotkey F1 to run this command in Vscode.

When you want to debug a project, select the. NET Core Debugging environment and press the Debug button to debug. When you first debug vs code, you can press the command Hotkey (F5) to select the debugging environment.

L If you want to press F5 to get ' compile ' support, you need to create a Tasks.json file. There are several ways to achieve this.

n You can press the hotkey F1 in Vscode to open the command line. Executes the command debugger:add tasks.json. (But make sure you have Monoinstalled).

N You can also add it manually to your Launch.json file for this purpose. If you do not have monoinstalled, you will get a one-line error message omnisharp not running .

N If you just want to debug the next program, you can Launch.json comment out the file. "Precompiletask" command.

L before you can start the program, you have to modify your Launch.json file. Enter the name of the executable program, including the path, in the Programs field location.

n If you are using the recommended. NET CLI generation scenario. The format is so,${workspaceroot}/bin/debug/dnxcore50/osx.10.11-x64/helloworld . Under Ubuntu platform, use ubuntu.14.04-x64 to replace OSX ... Folder. Under the Windows platform, use win7-x64. If you are not sure, enter dotnet build on the command line and look for the generated execution file (NOT.dll) under Path Bin/debug. You can still use forward slashes under the Windows platform.

n If you are using the new. NET CLI build scenario, ignore this step unless you really want to install the latest BITS service (the backend can only transfer the service). This scenario no longer defaults to deleting the local host's executable file. This point will be modified in future extended versions. But now, all you need is-

L for Windows platforms:

Https://github.com/OmniSharp/omnisharp-vscode/wiki/Portable-PDBs#net-cli-projects-projectjson (using Portable PDBs Modify the Project.json file).

If a storage error occurs because of a missing nuget.config file, simply create the file in your project root directory.

<?xml version= "1.0" encoding= "Utf-8"?>

<configuration>

<packageSources>

<!--to inherit the global NuGet package sources remove the <clear/> line below--

<clear/>

<add key= "Dotnet-core" value= "Https://www.myget.org/F/dotnet-core/api/v3/index.json"/>

<add key= "api.nuget.org" value= "Https://api.nuget.org/v3/index.json"/>

</packageSources>

</configuration>

Configure. NET Core Debugger

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.