diff --git a/src/mono/msbuild/android/build/AndroidBuild.props b/src/mono/msbuild/android/build/AndroidBuild.props
index 15c82b729c140..e1fea8973da87 100644
--- a/src/mono/msbuild/android/build/AndroidBuild.props
+++ b/src/mono/msbuild/android/build/AndroidBuild.props
@@ -8,7 +8,7 @@
<_HostOS Condition="$([MSBuild]::IsOSPlatform('OSX'))">osx
<_HostOS Condition="'$(_HostOS)' == ''">linux
- <_IsLibraryMode Condition="'$(NativeLib)' != ''">true
+ <_IsLibraryMode Condition="'$(UseNativeAOTRuntime)' != 'true' and '$(NativeLib)' != ''">true
Publish
diff --git a/src/mono/msbuild/apple/build/AppleBuild.props b/src/mono/msbuild/apple/build/AppleBuild.props
index 9ce0696b26260..8bb9e4c97480f 100644
--- a/src/mono/msbuild/apple/build/AppleBuild.props
+++ b/src/mono/msbuild/apple/build/AppleBuild.props
@@ -19,7 +19,7 @@
- <_IsLibraryMode Condition="'$(NativeLib)' != ''">true
+ <_IsLibraryMode Condition="'$(UseNativeAOTRuntime)' != 'true' and '$(NativeLib)' != ''">true
Publish
diff --git a/src/tests/build.proj b/src/tests/build.proj
index cca44fe29bf88..093828eb4172e 100644
--- a/src/tests/build.proj
+++ b/src/tests/build.proj
@@ -414,7 +414,6 @@
- $(IntermediateOutputPath)\..\$(TestRelativePath)\$(TestName)\native\$(TestName).o
-
true
true
@@ -423,6 +422,10 @@
false
+
+
+
+
<_LinkerFlagsToDrop Include="@(NativeFramework->'-framework %(Identity)')" />