我用谷歌搜索并查看了stackoverflow,但找不到解决方案。
设置:
主机操作系统:Ubuntu
ASPNet 核心 2
点网2.0
我有两个容器,一个用于 MySQL,另一个用于 dotnet core。我能够在不安装 CLR 调试器的情况下运行它。在一个容器中安装 CLR 调试器后,我尝试使用 Visual Studio Code 调试在该容器中运行的 aspnet core 2 应用程序。我收到以下错误:
“管道程序 'bash' 意外退出。”
唯一的选择是“打开 Launch.json”,并且在 launch.json 中只有 bash 命令是:
"pipeTransport": {
"pipeProgram": "/bin/bash",
"pipeCwd": "${workspaceRoot}",
"pipeArgs": ["-c",
"docker exec -i devexamapp_debug_1 /clrdbg/clrdbg --interpreter=mi"],
"debuggerPath": "/vsdbg/vsdbg"
调试控制台显示如下:
开始: "/bin/bash"-c "docker exec -i devexamapp_debug_1/clrdbg/clrdbg --interpreter=mi""/vsdbg/vsdbg --interpreter=vscode"
如果我在控制台窗口中运行 "/bin/bash"-c "docker exec -i devexamapp_debug_1/clrdbg/clrdbg --interpreter=mi""/vsdbg/vsdbg --interpreter=vscode"那么它可以 100% 正常工作错误。
我错过了什么?有什么帮助吗?
谢谢
最佳答案
编辑 1:10 月 14 日
您需要在 Docker 镜像中安装调试器。您可以通过将以下内容添加到您的 dockerfile 来执行相同的操作
WORKDIR /vsdbg
RUN curl -SL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /vsdbg
然后你需要更新
pipeTransport
在 launch.json
如下"pipeTransport": {
"pipeProgram": "docker",
"pipeCwd": "${workspaceRoot}",
"pipeArgs": ["exec -i devexamapp_debug_1"],
"debuggerPath": "/vsdbg/vsdbg",
"quoteArgs": false
}
关于ubuntu - Visual Studio Code Ubuntu aspnet core 2 容器调试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46698532/