visual-studio - Cannot Attach Debugger with Docker Containers in Visual Studio 2019 - Errors
问题描述
I am trying to run the Visual Studio debugger using after building my containers with docker-compose. The containers build fine and start up and are all listed in the containers view. The output windows shows everything to be fine and then issues 8 commands for each service:
========== Debugging ==========
docker ps --filter "status=running" --filter "label=com.docker.compose.service" --filter "name=^/dataapi$" --format {{.ID}} -n 1
e2490aa5ec53
docker ps --filter "status=running" --filter "label=com.docker.compose.service" --filter "name=^/statisticsapi$" --format {{.ID}} -n 1
275a0475c7f6
docker ps --filter "status=running" --filter "label=com.docker.compose.service" --filter "name=^/wellspacingapi$" --format {{.ID}} -n 1
99a1b4c77f28
docker ps --filter "status=running" --filter "label=com.docker.compose.service" --filter "name=^/dataworkflowsapi$" --format {{.ID}} -n 1
b900708dc919
docker ps --filter "status=running" --filter "label=com.docker.compose.service" --filter "name=^/griddingapi$" --format {{.ID}} -n 1
6d05117e9f5a
docker ps --filter "status=running" --filter "label=com.docker.compose.service" --filter "name=^/apigatewayocelot$" --format {{.ID}} -n 1
542dfca93543
docker ps --filter "status=running" --filter "label=com.docker.compose.service" --filter "name=^/identityserver$" --format {{.ID}} -n 1
74b5552affaa
docker ps --filter "status=running" --filter "label=com.docker.compose.service" --filter "name=^/loginserverapi$" --format {{.ID}} -n 1
c4ff67ab6a7a
I then get a "Microsoft Visual Studio" error dialog 8 times, one for each microservice, that says:
One or more errors occurred.
Failed to launch debug adapter. Additional information may be available in the output window.
The operation was cancelled.
The program '' has exited with code -1 (0xffffffff).
The program '' has exited with code -1 (0xffffffff).
The program '' has exited with code -1 (0xffffffff).
The program '' has exited with code -1 (0xffffffff).
The program '' has exited with code -1 (0xffffffff).
The program '' has exited with code -1 (0xffffffff).
The program '' has exited with code -1 (0xffffffff).
The program '' has exited with code -1 (0xffffffff).
A picture of the dialog:
What's even more frustrating is that my colleague has the exact same machine and software and version of the software as me and it works for him. My software version:
Visual Studio: 16.9.2
Docker version 20.10.5, build 55c4c88
dotnet --info:
.NET SDK (reflecting any global.json):
Version: 5.0.201
Commit: a09bd5c86c
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.201\
Host (useful for support):
Version: 5.0.4
Commit: f27d337295
.NET SDKs installed:
5.0.201 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
I have researched other problems that are similar, but none of their resolutions have worked for me. Any help is greatly appreciated!!
解决方案
推荐阅读
- javascript - Recoil:将长期存在的客户端对象传递给选择器
- python - 是否可以为 CPLEX 中的变量指定一组特定的值?
- php - 如何使通知与声音一起工作这不适用于声音甚至android中的默认通知声音
- python - 根据具有条件的其他列值创建新列
- google-sheets - 部分匹配一个范围的字符串与另一个范围的字符串,输出部分匹配
- php - 从 Laravel 中的关系中获取最后的记录
- apache-kafka - 在 Kaka Producer 中配置重试的最佳方式
- javascript - Webassembly.instantiate 期间如何定义最大内存?
- c# - 可空引用类型在具有临时可空字段的类中的使用
- memory-leaks - 如何阻止“com.newrelic.agent.Transaction”中的内存泄漏