diff --git a/src/Tgstation.Server.Host/Core/Application.cs b/src/Tgstation.Server.Host/Core/Application.cs index c0b7a53c03..e1461f63f4 100644 --- a/src/Tgstation.Server.Host/Core/Application.cs +++ b/src/Tgstation.Server.Host/Core/Application.cs @@ -295,7 +295,6 @@ namespace Tgstation.Server.Host.Core services.AddSingleton, PasswordHasher>(); // configure platform specific services -#pragma warning disable CA1416 // Validate platform compatibility if (postSetupServices.PlatformIdentifier.IsWindows) { AddWatchdog(services, postSetupServices); @@ -325,7 +324,6 @@ namespace Tgstation.Server.Host.Core services.AddSingleton(); } -#pragma warning restore CA1416 // Validate platform compatibility // configure component/misc services services.AddScoped(); diff --git a/src/Tgstation.Server.Host/System/IPlatformIdentifier.cs b/src/Tgstation.Server.Host/System/IPlatformIdentifier.cs index 26038d7887..805b93b97d 100644 --- a/src/Tgstation.Server.Host/System/IPlatformIdentifier.cs +++ b/src/Tgstation.Server.Host/System/IPlatformIdentifier.cs @@ -1,4 +1,6 @@ -namespace Tgstation.Server.Host.System +using System.Runtime.Versioning; + +namespace Tgstation.Server.Host.System { /// /// For identifying the current platform. @@ -8,6 +10,7 @@ /// /// If the current platform is a Windows platform. /// + [SupportedOSPlatformGuard("windows")] bool IsWindows { get; } /// diff --git a/src/Tgstation.Server.Host/System/PlatformIdentifier.cs b/src/Tgstation.Server.Host/System/PlatformIdentifier.cs index 38101248f6..22931b97ce 100644 --- a/src/Tgstation.Server.Host/System/PlatformIdentifier.cs +++ b/src/Tgstation.Server.Host/System/PlatformIdentifier.cs @@ -1,4 +1,5 @@ using System.Runtime.InteropServices; +using System.Runtime.Versioning; namespace Tgstation.Server.Host.System { @@ -6,6 +7,7 @@ namespace Tgstation.Server.Host.System sealed class PlatformIdentifier : IPlatformIdentifier { /// + [SupportedOSPlatformGuard("windows")] public bool IsWindows { get; } ///