VS code debugging. NET Core applications The pits that are encountered why there is a "pit"
There are a lot of blog parks that describe how to use vs Code and Debug. NET core articles, but are all based on the direct build of ASP.
(1). The pit we encountered this time is encountered in a multi-project solution , which means that the root directory is not a project directory;
(2). Debug project cannot load symbol file, cause project cannot debug breakpoint ;
Troubleshooting issues 1. Directory Issues with Solutions
Modify the "program" node in Launch.json:
Program: "${workspaceroot}", Workspaceroot is the solution directory, modify this value to "${workspaceroot}/subproject directory/bin/debug/netcoreapp1.0/ < project name >.dll "
After the modification, debug found no way to build, prompting couldn ' t find ' Project.json ' in the current directory.
In fact, the reason is the same is not found in the project directory caused by, modify the Tasks.json file:
Add an Options node for it:
{ //See https://go.microsoft.com/fwlink/? linkid=733558 //For the documentation about the Tasks.json format "version": "0.1.0", "command": "Dotnet", "Isshellcommand": True, "args": [], "Options": { "CWD": "${workspaceroot}/sub-project directory" }, "Tasks": [ { "taskname": "Build", "args": [], "Isbuildcommand": True, " Showoutput ":" Silent ", " Problemmatcher ":" $msCompile " } ]}
The CWD node of the options, which specifies the working directory of the dotnet command line, can be modified to build normally.
2. Debug not Breakpoint debugging
Looking at log, you will be prompted with the following information when debugging:
Could not load symbols for ' *.dll '. ' *.pdb ' is a Windows pdb. These is not supported by the Cross-platform. NET Core Debugger.
Probably means that a symbol file generated under Windows cannot be loaded by a cross-platform debugger.
The solution is simple, in each project file (Project.json) that needs to be debugged, add a node information as follows:
"Buildoptions": { "debugtype": "Portable" }
Project.json
This is a project.json fragment of an YOYOFX open source framework project.
YOYOFX Frame
GITHUB:HTTPS://GITHUB.COM/MAXZHANG1985/YOYOFX Star, Welcome to the exchange.
YOYOFX is a lightweight for building HTTP-based WEB services based on the. NET and Mono platforms.
VS code debugging. NET Core