【发布时间】:2022-10-15 05:42:40
【问题描述】:
我正在使用 Visual Studio 2022 17.3.3 并已将远程测试配置为使用 docker 映像。当我在“测试资源管理器”中切换远程环境时,出现以下错误:
Docker remote environment is starting using image 'pbagent:17.0.06'.
Connected to test environment 'Docker dotnet/sdk'
Microsoft.VisualStudio.Containers.Tools.Common.ContainerToolsException: Docker command failed with exit code 1.
Error response from daemon: invalid volume specification: 'c:\program files\microsoft visual studio\2022\enterprise\common7\ide\commonextensions\microsoft\testwindow\RemoteAgent:/mnt/testwindowremoteagent/:ro'
If the error persists, try restarting Docker Desktop.
at Microsoft.VisualStudio.Containers.Tools.Common.Client.DockerClient.ReportDockerCommandFailed(CommandLineResult result, String errorCode, String telemetrySafeArguments)
at Microsoft.VisualStudio.Containers.Tools.Common.Client.DockerClient.<CreateContainerAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.TestWindow.Host.TestPlatformProviders.DockerTestPlatformProvider.<ActivateSessionAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.TestWindow.Host.TestPlatformAgentPool.<>c__DisplayClass24_0.<<CreateRemoteAgentAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.TestWindow.Utilities.EventPumpExtensions.<>c__DisplayClass4_0`1.<<EnqueueAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.TestWindow.Host.TestPlatformProvider.<UpdateRuntimeEnvironmentsAsync>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.TestWindow.Logging.ILoggerExtensions.<CallWithCatchAsync>d__11`1.MoveNext()
Error code: CTC1015
Severity: Error
Command line: docker container create -t -v "c:\program files\microsoft visual studio\2022\enterprise\common7\ide\commonextensions\microsoft\testwindow\RemoteAgent:/mnt/testwindowremoteagent/:ro" -v "c:\program files\microsoft visual studio\2022\enterprise\common7\ide\commonextensions\microsoft\testwindow\VsTest:/mnt/vstest/:ro" -v "C:\repos\nf\Platform.AssetDataCollector\:/mnt/approot/" -p 63959:63959 pbagent:17.0.06
Command exit code: 1
Command output:
Command error: Error response from daemon: invalid volume specification: 'c:\program files\microsoft visual studio\2022\enterprise\common7\ide\commonextensions\microsoft\testwindow\RemoteAgent:/mnt/testwindowremoteagent/:ro'
我尝试重新启动 Visual Studio 和 Docker Desktop(如输出日志中所建议的那样),我以管理员身份运行 Visual Studio。
我相信 Visual Studio 正在尝试将源目录挂载到容器内,但 Docker 失败并出现错误 CT1015。
我的 testEnvironments.json 是:
{
"version": "1",
"environments": [
// See https://aka.ms/remotetesting for more details
// about how to configure remote environments.
//{
// "name": "WSL Ubuntu",
// "type": "wsl",
// "wslDistribution": "Ubuntu"
//},
{
"name": "Docker dotnet/sdk",
"type": "docker",
"dockerImage": "pbagent:17.0.06"
}
]
}
【问题讨论】:
标签: .net docker visual-studio-2022 docker-for-windows test-environments