You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VS2022无法运行远程测试问题求助

远程MSTest单元测试连接问题排查请求

我按照VS2022官方远程测试指南搭建了环境,目标是从Windows10 64位系统通过VS2022(17.3.4)控制/调试Windows10 32位系统上的.NET Framework MSTest单元测试。

已安装组件

  • OpenSSH Server:可通过SSH客户端正常连接
  • VS2022远程调试器:C++程序远程调试功能正常
  • VS2022测试代理:可交互式启动,但显示因无可用测试控制器处于断开状态
    Test Agent状态
  • 尝试安装测试控制器,但因依赖SQL Server Express无法完成配置

代理启动时弹出错误提示:
Test Agent启动提示框

问题现象

尝试发现远程测试时始终失败,报错:
System.IO.EndOfStreamException: Expected 20 bytes but only received 0 before the stream ended
切换到远程环境后,测试资源管理器中无任何测试显示。

配置文件内容

testEnvironments.json内容如下:

{
    "version": "1",
    "environments": [
        {
            "name": "Windows10x32",
            "type": "ssh",
            "remoteUri": "ssh://Admin@VW10X32:22"
        }
    ]
}

添加"localRoot": "D:\\MyProjects\\MyApp"后无任何效果。

完整错误日志

Connecting to remote test environment using SSH at ssh://Admin@VW10X32:22/
Detected Windows remote environment.
Connected to test environment 'Windows10x32'
System.IO.EndOfStreamException: Expected 20 bytes but only received 0 before the stream ended.
   at Nerdbank.Streams.StreamExtensions.<ReadBlockOrThrowAsync>d__8.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 Nerdbank.Streams.MultiplexingStream.V1Formatter.<ReadHandshakeAsync>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 Nerdbank.Streams.MultiplexingStream.<CreateAsync>d__43.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.ServiceHub.Framework.RemoteServiceBroker.<ConnectToMultiplexingServerAsync>d__24.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.SSHTestPlatformProvider.<ActivateSessionAsync>d__7.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()

从日志判断,部分组件未对请求做出正确或及时响应,求解决该问题的思路?

内容的提问来源于stack exchange,提问作者AntonK

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.22 19:15:13