【发布时间】:2017-12-18 23:54:23
【问题描述】:
我有一个在 Windows Docker 容器中运行的 .NET Core 应用程序,我想将 Visual Studio 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"
将调试器附加到远程进程后,当我尝试访问该站点时,它只是挂起。 Visual Studio Code 列出线程并在终端中显示一些 JSON,但没有任何反应。与它断开连接会关闭容器。为什么会这样?
【问题讨论】:
标签: .net debugging docker visual-studio-code .net-core