Visual Studio代码Ubuntu的aspnet core 2容器debugging

我GOOGLE了,看着stackoverflow,但无法find解决办法。

build立:

主机操作系统:Ubuntu

ASPNet Core 2

Dotnet 2.0


我有两个容器,一个用于MySQL的容器,另一个用于dotnet核心。 我能够在不安装CLRdebugging器的情况下运行它。 在一个容器中安装CLRdebugging器后,我试图使用Visual Studio代码来debugging运行在该容器中的aspnet core 2应用程序。 我收到以下错误:

“pipe道程序”bash“意外退出。”

唯一的select是“打开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" 

debugging控制台显示如下:

开始:“/ 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:14 – 10月

你需要在你的Docker映像中安装debugging器。 你可以通过下面的代码添加到你的docker文件中

 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 }