From 49e6dbbbf893368e213eca36b7912a416b19d26d Mon Sep 17 00:00:00 2001 From: Katherine Reynolds <7054971+reynoldskr@users.noreply.github.com> Date: Wed, 22 Oct 2025 19:27:05 -0700 Subject: [PATCH 1/2] Updated DesktopOsHelper.IsMac to work properly on net10 + macOS 26 --- .../PlatformsCommon/Shared/DesktopOsHelper.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/Microsoft.Identity.Client/PlatformsCommon/Shared/DesktopOsHelper.cs b/src/client/Microsoft.Identity.Client/PlatformsCommon/Shared/DesktopOsHelper.cs index f9e6e8aa33..97f6bf1819 100644 --- a/src/client/Microsoft.Identity.Client/PlatformsCommon/Shared/DesktopOsHelper.cs +++ b/src/client/Microsoft.Identity.Client/PlatformsCommon/Shared/DesktopOsHelper.cs @@ -53,7 +53,10 @@ public static bool IsMac() return Environment.OSVersion.Platform == PlatformID.MacOSX; #elif NET8_0_OR_GREATER string OSDescription = RuntimeInformation.OSDescription; - return OSDescription.Contains("Darwin", StringComparison.OrdinalIgnoreCase); + + // .NET 10 and later changes the OS string in `OSDescription` + return OSDescription.Contains("Darwin", StringComparison.OrdinalIgnoreCase) || + OSDescription.Contains("macOS", StringComparison.OrdinalIgnoreCase); #else return RuntimeInformation.IsOSPlatform(OSPlatform.OSX); #endif From a18c778dc829aae07257c1264dca29d57b128421 Mon Sep 17 00:00:00 2001 From: Katherine Reynolds <7054971+reynoldskr@users.noreply.github.com> Date: Wed, 3 Dec 2025 11:35:44 -0800 Subject: [PATCH 2/2] Simplified MacOS detection --- .../PlatformsCommon/Shared/DesktopOsHelper.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/client/Microsoft.Identity.Client/PlatformsCommon/Shared/DesktopOsHelper.cs b/src/client/Microsoft.Identity.Client/PlatformsCommon/Shared/DesktopOsHelper.cs index 97f6bf1819..d6c67212fe 100644 --- a/src/client/Microsoft.Identity.Client/PlatformsCommon/Shared/DesktopOsHelper.cs +++ b/src/client/Microsoft.Identity.Client/PlatformsCommon/Shared/DesktopOsHelper.cs @@ -52,11 +52,7 @@ public static bool IsMac() #elif NETFRAMEWORK return Environment.OSVersion.Platform == PlatformID.MacOSX; #elif NET8_0_OR_GREATER - string OSDescription = RuntimeInformation.OSDescription; - - // .NET 10 and later changes the OS string in `OSDescription` - return OSDescription.Contains("Darwin", StringComparison.OrdinalIgnoreCase) || - OSDescription.Contains("macOS", StringComparison.OrdinalIgnoreCase); + return OperatingSystem.IsMacOS(); #else return RuntimeInformation.IsOSPlatform(OSPlatform.OSX); #endif