diff --git a/src/Tmds.DBus.Protocol/PlatformDetection.cs b/src/Tmds.DBus.Protocol/PlatformDetection.cs index 0d77b5fa..5f272b84 100644 --- a/src/Tmds.DBus.Protocol/PlatformDetection.cs +++ b/src/Tmds.DBus.Protocol/PlatformDetection.cs @@ -1,7 +1,13 @@ namespace Tmds.DBus.Protocol; +#if NET6_0_OR_GREATER +using System.Runtime.Versioning; +#endif static class PlatformDetection { +#if NET6_0_OR_GREATER + [SupportedOSPlatformGuard("windows")] +#endif public static bool IsWindows() => #if NET6_0_OR_GREATER // IsWindows is marked with the NonVersionable attribute. diff --git a/src/Tmds.DBus/Address.cs b/src/Tmds.DBus/Address.cs index 1aef9815..8125bdf1 100644 --- a/src/Tmds.DBus/Address.cs +++ b/src/Tmds.DBus/Address.cs @@ -145,7 +145,7 @@ private static string GetSessionBusAddressFromX11() } #if NET6_0_OR_GREATER - [SupportedOSPlatform("Windows")] + [SupportedOSPlatform("windows")] #endif private static string GetSessionBusAddressFromSharedMemory() { @@ -156,7 +156,7 @@ private static string GetSessionBusAddressFromSharedMemory() } #if NET6_0_OR_GREATER - [SupportedOSPlatform("Windows")] + [SupportedOSPlatform("windows")] #endif private static string ReadSharedMemoryString(string id, long maxlen = -1) { diff --git a/src/Tmds.DBus/Environment.cs b/src/Tmds.DBus/Environment.cs index daffdfbc..7803f371 100644 --- a/src/Tmds.DBus/Environment.cs +++ b/src/Tmds.DBus/Environment.cs @@ -20,7 +20,7 @@ internal static class Environment public static readonly EndianFlag NativeEndianness; #if NET6_0_OR_GREATER - [SupportedOSPlatformGuard("Windows")] + [SupportedOSPlatformGuard("windows")] #endif public static readonly bool IsWindows;