我有一个.net核心应用程序在Windows Docker容器中运行,我想将VS Code附加到。当我附加到远程进程时,似乎进程冻结,如果我断开调试器,容器将关闭而没有任何错误。
launch.json
{
"name": ".NET Core Remote Attach",
"type": "coreclr",
"request": "attach",
"pipeTransport": {
"pipeProgram": "powershell",
"pipeArgs": ["docker exec -i --privileged amazing_johnson" ],
"pipeCwd": "${workspaceRoot}",
"debuggerPath": "c:\\coreclr-debug\\vsdbg.exe"
},
"processId": "1736"
},
调试输出控制台中的结果:
Starting: "powershell" "docker exec -i --privileged amazing_johnson" "c:\coreclr-debug\vsdbg.exe --interpreter=vscode"
将调试器附加到远程进程后,当我尝试访问该站点时,它只是挂起,VSCode列出了线程并在终端中显示了一些JSON但没有任何反应。断开连接会关闭容器。为什么会这样?