提交 40aef0c4 编写于 作者: S Sam Harwell

Ignore IOException when setting OutputEncoding

See #47571
上级 20760c91
......@@ -18,6 +18,7 @@
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.ErrorReporting;
using Microsoft.CodeAnalysis.Scripting;
using Microsoft.CodeAnalysis.Scripting.Hosting;
using Roslyn.Utilities;
......@@ -140,7 +141,15 @@ private Service(Func<Func<object>, object> invokeOnMainThread)
_lastTask = Task.FromResult(initialState);
Console.OutputEncoding = Encoding.UTF8;
try
{
Console.OutputEncoding = Encoding.UTF8;
}
catch (IOException ex) when (FatalError.ReportWithoutCrash(ex))
{
// Ignore this exception
// https://github.com/dotnet/roslyn/issues/47571
}
// We want to be sure to delete the shadow-copied files when the process goes away. Frankly
// there's nothing we can do if the process is forcefully quit or goes down in a completely
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册