diff --git a/src/Microsoft.DotNet.Watcher.Tools/CommandOutputProvider.cs b/src/Microsoft.DotNet.Watcher.Tools/CommandOutputProvider.cs index a7ce107196..595b713b0e 100644 --- a/src/Microsoft.DotNet.Watcher.Tools/CommandOutputProvider.cs +++ b/src/Microsoft.DotNet.Watcher.Tools/CommandOutputProvider.cs @@ -1,9 +1,8 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; -using Microsoft.Extensions.PlatformAbstractions; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.PlatformAbstractions; namespace Microsoft.DotNet.Watcher.Tools { @@ -11,9 +10,9 @@ namespace Microsoft.DotNet.Watcher.Tools { private readonly bool _isWindows; - public CommandOutputProvider(IRuntimeEnvironment runtimeEnv) + public CommandOutputProvider() { - _isWindows = runtimeEnv.OperatingSystem == "Windows"; + _isWindows = PlatformServices.Default.Runtime.OperatingSystemPlatform == Platform.Windows; } public ILogger CreateLogger(string name) diff --git a/src/Microsoft.DotNet.Watcher.Tools/Program.cs b/src/Microsoft.DotNet.Watcher.Tools/Program.cs index 776cf0cd2a..8ea1b8a2f0 100644 --- a/src/Microsoft.DotNet.Watcher.Tools/Program.cs +++ b/src/Microsoft.DotNet.Watcher.Tools/Program.cs @@ -22,7 +22,7 @@ namespace Microsoft.DotNet.Watcher.Tools { _loggerFactory = new LoggerFactory(); - var commandProvider = new CommandOutputProvider(PlatformServices.Default.Runtime); + var commandProvider = new CommandOutputProvider(); _loggerFactory.AddProvider(commandProvider); }