Skip to content

Commit 49e6dbb

Browse files
committed
Updated DesktopOsHelper.IsMac to work properly on net10 + macOS 26
1 parent a5c1ffb commit 49e6dbb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/client/Microsoft.Identity.Client/PlatformsCommon/Shared/DesktopOsHelper.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ public static bool IsMac()
5353
return Environment.OSVersion.Platform == PlatformID.MacOSX;
5454
#elif NET8_0_OR_GREATER
5555
string OSDescription = RuntimeInformation.OSDescription;
56-
return OSDescription.Contains("Darwin", StringComparison.OrdinalIgnoreCase);
56+
57+
// .NET 10 and later changes the OS string in `OSDescription`
58+
return OSDescription.Contains("Darwin", StringComparison.OrdinalIgnoreCase) ||
59+
OSDescription.Contains("macOS", StringComparison.OrdinalIgnoreCase);
5760
#else
5861
return RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
5962
#endif

0 commit comments

Comments
 (0)