如果我创建了一个启用Docker支持的ASP Core MVC(目标框架5.0),并启动它,我会得到以下错误提示:
"发生了一个或多个错误。无法启动调试适配器。其他信息可能在输出窗口中提供。操作已取消。"
这是调试输出:
启用DebugAdapterHost.Logging并附加以下参数:
DebugAdapterHost.Logging /On /OutputWindow
给出以下输出:
1> DebugAdapterHost version: 16.9.50429.2 commit:ca34bde2a8dfef71e1d0b3bafd2804978bfbe6a9
1> Starting 'docker' with arguments 'exec -i 7ce0da2e24860812b487ef583433deee7b411229b69c5631dc73027fd0864f1f /bin/sh -c "ID=.; if [ -e /etc/os-release ]; then . /etc/os-release; fi; if [ $ID = alpine ] && [ -e /remote_debugger/linux-musl-x64/vsdbg ]; then VSDBGPATH=/remote_debugger/linux-musl-x64; else VSDBGPATH=/remote_debugger; fi; $VSDBGPATH/vsdbg --interpreter=vscode"'
1> [DebugAdapter] --> C (initialize-1): {"type":"request","command":"initialize","arguments":{"pathFormat":"path","clientID":"visualstudio","clientName":"Visual Studio","adapterID":"coreclr","locale":"en-US","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsRunInTerminalRequest":true,"supportsMemoryReferences":true,"supportsProgressReporting":true,"SupportsMessageBox":true,"supportsHandshakeRequest":true,"supportsVsAdditionalBreakpointBinds":true,"supportsHitCountsChange":true,"supportsVsCustomMessages":true,"supportsVariableEnumerators":true},"seq":1}
1> ERROR: Debug adapter error output: /bin/sh: 1: /remote_debugger/vsdbg: not found
1> ERROR: Debug Adapter did not respond to initial requests.
1> ERROR: Unexpected error
AggregateException: One or more errors occurred.
Aggregate exception:
DebugAdapterLaunchException: Failed to launch debug adapter. Additional information may be available in the output window.
Failure Location: UserCanceled
Inner Exception:
OperationCanceledException: The operation was canceled.
Inner Exception:
DebugAdapterLaunchException: Failed to launch debug adapter. Additional information may be available in the output window.
Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost.Engine.Implementation.DebuggedProcess.<StartDebugAdapter>b__114_3(Exception ex)
Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost.Utilities.TaskExtensions.<>c__DisplayClass11_0`1.<Catch>b__0(TException ex)
Microsoft.VisualStudio.Debugger.VSCodeDebuggerHost.Utilities.TaskExtensions.<>c__DisplayClass10_0`1.<Catch>b__0(AggregateException ex)
Failure Location: UserCanceled
Inner Exception:
OperationCanceledException: The operation was canceled.
1> Debug adapter process exited.
1> ERROR: One or more errors occurred.
Failed to launch debug adapter. Additional information may be available in the output window.
The operation was canceled.
我已经尝试重新安装Docker桌面版和Visual Studio 2022,同时Windows 11已经完全更新。
我可以直接在Docker桌面版中构建和运行Nginx镜像而不出现错误,因此我认为问题与我的Visual Studio 2022安装有关。
我的配置:
Docker桌面版4.5.1
Microsoft Visual Studio Community 2022(64位)- 17.1.0
Windows 11 Home
我还尝试了降级到以下版本:
Docker桌面版4.4.4
Microsoft Visual Studio Community 2019(64位)
但结果完全相同。