From 21dad8adb5be784b76a52910b74d25296cf9ebaa Mon Sep 17 00:00:00 2001 From: Vatsan Madhavan Date: Mon, 19 Nov 2018 15:43:54 -0800 Subject: [PATCH] Fixing DrtBase.cs to ensure that it doens't crash XUnit console runner. Updating global.json version. --- global.json | 2 +- .../test/Common/TestServices/DrtBase.cs | 20 ++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/global.json b/global.json index 52c8b356b17..946f901baea 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "3.0.100-preview-009756", + "dotnet": "3.0.100-preview-009764", "vswhere": "2.5.2" }, "msbuild-sdks": { diff --git a/src/Microsoft.DotNet.Wpf/test/Common/TestServices/DrtBase.cs b/src/Microsoft.DotNet.Wpf/test/Common/TestServices/DrtBase.cs index f6002337b80..134735b2538 100644 --- a/src/Microsoft.DotNet.Wpf/test/Common/TestServices/DrtBase.cs +++ b/src/Microsoft.DotNet.Wpf/test/Common/TestServices/DrtBase.cs @@ -2712,7 +2712,13 @@ public override void Write(char value) _logFile.Flush(); } - _output.WriteLine($"{value}"); + try + { + _output.WriteLine($"{value}"); + } + catch + { + } } } @@ -2733,7 +2739,11 @@ public override void Write(char[] buffer, int index, int count) var sb = new StringBuilder(); sb.Append(buffer, index, count); - _output.WriteLine(sb.ToString()); + try + { + _output.WriteLine(sb.ToString()); + } + catch { } } } @@ -2764,7 +2774,11 @@ public override void Write(string value) _logFile.Flush(); } - _output.WriteLine(value); + try + { + _output.WriteLine(value); + } + catch { } } }