Skip to content

Commit a18c778

Browse files
committed
Simplified MacOS detection
1 parent 49e6dbb commit a18c778

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ public static bool IsMac()
5252
#elif NETFRAMEWORK
5353
return Environment.OSVersion.Platform == PlatformID.MacOSX;
5454
#elif NET8_0_OR_GREATER
55-
string OSDescription = RuntimeInformation.OSDescription;
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);
55+
return OperatingSystem.IsMacOS();
6056
#else
6157
return RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
6258
#endif

0 commit comments

Comments
 (0)