Sometimes when I run my tests (.Net Standard 2.0 project using XUnit) I get an error in the Tests output pane saying:
[25.09.2018 1:46:36 Error] System.IO.IOException: No process is on the other end of the pipe."
And then I can't run the tests any more until I restart the Visual Studio. Here's the full stacktrace for the error:
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()
Is there anything I can do to get rid of this annoying behavior?
Just update your Visual Studio 2017 to the latest version and this nasty bug is gone.