Support Child Process Debugging
See original GitHub issuelaunch configuration looks something like
{
"name": ".NET Debug Tool",
"type": "coreclr",
"request": "launch",
"program": "dotnet",
"args": [
"tool",
"run",
"{toolname}"
],
"cwd": "${workspaceRoot}",
"stopAtEntry": true,
"externalConsole": false,
"justMyCode": false,
"symbolOptions": {
"searchNuGetOrgSymbolServer": true
}
}
I supect this is becauase tools are launched as a child process i.e:
dotnet tool run "toolname"
will with local manifest i.e. resolve tool in nuget cache and start a new process something like
dotnet.exe C:\Users\{user}\.nuget\packages\{toolname}\{version}\tools/{framework moniker}/any/{tool}.dll
If change to launch C:\Users\{user}\.nuget\packages\{toolname}\{version}\tools/{framework moniker}/any/{tool}.dll directly debugging works directly from F5 but that doesn’t scale between machines and how tools are resolved arent super obvious.
Is there anything avail/planned like Node.JS autoAttachChildProcesses?
Attaching manually works, but that also requires .NET tool to wait for debugger.
If manually attaching is only option it would be nice if it could be automated i.e. i could expose child process id in console output so if there were something serverReadyAction where the action wasn’t openExternally but something like
"serverReadyAction": {
"action": "attachDebugger",
"pattern": "\\bAttach debugger to process\\s([0-9]+)\\b to continue\\.\\.\\.",
}
To find a pattern like Attach debugger to process xxxxx to continue...
In full Visual Studio it works by installing the Microsoft Child Process Debugging Power Tool
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
I will leave this issue open to track doing the work to consume https://github.com/dotnet/runtime/issues/43924 in this extension.
Current the Child Process Debugging Power Tool is currently the only way to do this. I opened https://github.com/dotnet/runtime/issues/43924 – the .NET team has had this request many times before, but it doesn’t seem like anyone opened a GitHub issue for it, so I fixed that.
If you are on Windows, using Visual Studio + the Child Process Debugging Power Tool is probably your best option. If you are not on Windows, I would probably recommend adding some sort of command line switch or environment variable that caused your code to do:
Then you can attach.
I like your idea on
serverReadyActionbut this extension doesn’t ownserverReadyAction. I think you would file such a suggestion against the VS Code team.