Skip to content

Commit 62124e7

Browse files
authored
Fix macOS detection to include maccatalyst target in desktop platform checks (#5882)
* Update DesktopOsHelper.cs * Update DesktopOsHelper.cs * Update nativeinterop to 0.20.4
1 parent 04351ab commit 62124e7

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
44
<!-- Version of the Microsoft.Identity.Client.NativeInterop package. -->
5-
<MSALRuntimeNativeInteropVersion>0.20.3</MSALRuntimeNativeInteropVersion>
5+
<MSALRuntimeNativeInteropVersion>0.20.4</MSALRuntimeNativeInteropVersion>
66
<!-- Version of MSAL if not defined by the CI-->
77
<MsalInternalVersion>4.61.0</MsalInternalVersion>
88
<!-- Version of Microsoft.Identity.Lab.Api if not defined by the CI-->

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ public static bool IsMac()
5252
#elif NETFRAMEWORK
5353
return Environment.OSVersion.Platform == PlatformID.MacOSX;
5454
#elif NET8_0_OR_GREATER
55-
return OperatingSystem.IsMacOS();
55+
return OperatingSystem.IsMacOS() || OperatingSystem.IsMacCatalyst();
5656
#else
57-
return RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
57+
return RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ||
58+
RuntimeInformation.OSDescription.IndexOf("Darwin", StringComparison.OrdinalIgnoreCase) >= 0;
5859
#endif
5960
}
6061

tests/devapps/MacConsoleAppWithBroker/MacConsoleAppWithBroker.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<TargetPath>msalruntime_arm64.dylib</TargetPath>
2020
</None> -->
2121

22-
<PackageReference Include="Microsoft.Identity.Client.NativeInterop" Version="0.20.3" />
22+
<PackageReference Include="Microsoft.Identity.Client.NativeInterop" Version="0.20.4" />
2323

2424
</ItemGroup>
2525

tests/devapps/MacMauiAppWithBroker/MacMauiAppWithBroker.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
</ItemGroup> -->
9090

9191
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))">
92-
<PackageReference Include="Microsoft.Identity.Client.NativeInterop" Version="0.20.3" />
92+
<PackageReference Include="Microsoft.Identity.Client.NativeInterop" Version="0.20.4" />
9393
</ItemGroup>
9494

9595
<ItemGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))">

0 commit comments

Comments
 (0)