diff --git a/samples/BenchmarkDotNet.Samples.Forms/BenchmarkDotNet.Samples.Forms.csproj b/samples/BenchmarkDotNet.Samples.Forms/BenchmarkDotNet.Samples.Forms.csproj index ddec326433..38821b022a 100644 --- a/samples/BenchmarkDotNet.Samples.Forms/BenchmarkDotNet.Samples.Forms.csproj +++ b/samples/BenchmarkDotNet.Samples.Forms/BenchmarkDotNet.Samples.Forms.csproj @@ -10,7 +10,6 @@ - diff --git a/src/BenchmarkDotNet/Running/ConsoleTitler.cs b/src/BenchmarkDotNet/Running/ConsoleTitler.cs index 7983776e3c..9f8e21a1fe 100644 --- a/src/BenchmarkDotNet/Running/ConsoleTitler.cs +++ b/src/BenchmarkDotNet/Running/ConsoleTitler.cs @@ -20,10 +20,17 @@ internal class ConsoleTitler : IDisposable public ConsoleTitler(string initialTitle) { - // Return without enabling if Console output is redirected. - if (Console.IsOutputRedirected) + try + { + // Return without enabling if Console output is redirected. + if (Console.IsOutputRedirected) + { + return; + } + } + catch (PlatformNotSupportedException) { - return; + // Ignore the exception. Some platforms do not support Console.IsOutputRedirected. } try