有时,当我运行测试(使用 XUnit 的 .Net Standard 2.0 项目)时,我在测试输出窗格中收到错误消息:
[25.09.2018 1:46:36 错误] System.IO.IOException:管道的另一端没有进程。"
然后我无法再运行测试,直到我重新启动 Visual Studio。这是错误的完整堆栈跟踪:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.Console.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
at System.Console.get_ForegroundColor()
at Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions.SetColorForAction(ConsoleColor foregroundColor, Action action)
at Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions.Warning(IOutput output, Boolean appendPrefix, String format, Object[] args)
at Microsoft.VisualStudio.TestPlatform.CommandLine.Internal.ConsoleLogger.RaiseTestRunWarning(String warningMessage)
at Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers.TestRequestManager.UpdateRunSettingsIfRequired(String runsettingsXml, List`1 sources, String& updatedRunSettingsXml)
at Microsoft.VisualStudio.TestPlatform.CommandLine.TestPlatformHelpers.TestRequestManager.RunTests(TestRunRequestPayload testRunRequestPayload, ITestHostLauncher testHostLauncher, ITestRunEventsRegistrar testRunEventsRegistrar, ProtocolConfig protocolConfig)
at Microsoft.VisualStudio.TestPlatform.Client.DesignMode.DesignModeClient.<>c__DisplayClass19_0.<StartTestRun>b__0()
我能做些什么来摆脱这种烦人的行为吗?