1. Environment Windows,.net Core 2.0,vs Code
dotnet> dotnet New Console-o myApp
2.launch.json configuration file
{ //Use IntelliSense to find out which attributes exist for C # debugging//Use hover for the description of the existing attributes//For further information visithttps://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md "version":"0.2.0", "configurations": [ { "name":". NET Core Launch (console)", "type":"coreclr", "Request":"Launch", "Prelaunchtask":"Build", //If you had changed target frameworks, make sure to update the program path. " Program":"${workspacefolder}/myapp/bin/debug/netcoreapp2.0/myapp.dll", "args": [], "CWD":"${workspacefolder}/myapp", //for more information on the ' Console ' field, seehttps://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window "Console":"Internalconsole", "Stopatentry":false, "internalconsoleoptions":"Openonsessionstart" }, { "name":". NET Core Attach", "type":"coreclr", "Request":"Attach", "processId":"${command:pickprocess}" } ,]}
In the Launch.json
Name: Configuration names, In the Boot Configuration drop-down menu, display Type: Configuration type request: Requests configuration type (typically launch or attach) to run or attach Prelaunchtask: The task to run before the debugging session program: the DLL that is generated after the application build, the default is ${workspacefolder}/bin/debug/(target-framework)/(Project-name.dll) Workspacefolder: The path to the working directory of the program being debugged. Default to the current workspace (that is, the directory entered with the code command) Target-framework: Frame args: command-line arguments passed to the program CWD: Project directory console: Where to start the debug target stopatentry: If the debugger stops at the target's entry point, The default is falseinternalconsoleoptions: The control behavior of the internal debug console ProcessID: The process ID to attach to. Use "$ {command:pickprocess}" to get the list of running processes to attach to. If you use "ProcessId", you should not use "ProcessName". Note: in the. NET Core 1.0 Release externalconsole:console separate boot configuration, when you develop the console, if you need to enter after debugging, set the value to True, the console can be started separately.
Introduction to. NET Core Launch.json