c# - 活动的测试运行已中止。System.Reflection.TargetInvocationException
问题描述
在运行测试方法时遇到以下问题,但并非总是如此。一旦我遇到这个问题,我就无法进一步运行任何其他测试方法。
The active Tests Run was aborted.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.BufferedStream.WriteByte(Byte value)
at System.IO.BinaryWriter.Write(Byte value)
at System.IO.BinaryWriter.Write7BitEncodedInt(Int32 value)
at System.IO.BinaryWriter.Write(String value)
at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.WriteAndFlushToChannel(String rawMessage)
at M
icrosoft.VisualStudio.TestPlatform.CommunicationUtilities.SocketCommunicationManager.SendMessage(String messageType)
at Microsoft.TestPlatform.VsTestConsole.TranslationLayer.VsTestConsoleRequestSender.AbortTestRun()
at Microsoft.TestPlatform.VsTestConsole.TranslationLayer.VsTestConsoleWrapper.AbortTestRun() at Microsoft.VisualStudio.TestWindow.TestPlatformV2.ProxyRunRequest.Abort()
at Microsoft.VisualStudio.TestWindow.TestPlatformV2.ProxyRunRequest.Dispose()
at Microsoft.VisualStudio.TestWindow.Controller.Request.<RunRequests>d__95.MoveNext()
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.TestWindow.Controller.Request.<ProcessRequest>d__94.MoveNext()
========== Run test finished: 0 run (0:00:00.0408906) ==========
Can i get any solution for this error other than upgrading to latest version of VS 2019. Currently I am using VS 2019 version 16.2.
解决方案
推荐阅读
- javascript - React - 找不到模块 fs 并且未定义要求
- javascript - JavaScript-在滚动时更改导航样式
- javascript - Javascript倒计时问题
- java - 错误 404:ajax 无法连接到 @requestmapping
- javascript - 如何将按钮放在我的模板的 ag 网格表的每一行的单元格上?
- swift - 产品在购物车中时显示数量标签(Swift 5)
- r - R中开关功能的奇怪行为
- python - 有没有办法在两个数据帧之间进行比较,它们的列名在单独的数据帧中?
- database - Teradata如何创建inter类型和长度为30的列
- flutter - 变量没有在颤动中改变超出当时的范围