From 6c1a99cde9cb72a0c58db9da852c4da29e876c55 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Tue, 7 Jul 2026 11:39:42 +0200 Subject: [PATCH 1/2] Fix NETSDK1242 build breaks on NativeAOT and Mono mobile smoke test The .NET 11 SDK 11.0.100-preview.6.26352.110 added check NETSDK1242, which errors when a project targets a mobile platform (ios/tvos/maccatalyst/android) with the Mono runtime. The CoreCLR mobile legs already pass /p:UseMonoRuntime=false so the check never fires for them, but the NativeAOT legs do not, so the mobile inner target frameworks of the multi-targeted libs.tests projects default to Mono during restore and fail the build. Force UseMonoRuntime off whenever UseNativeAOTRuntime is set, since NativeAOT is CoreCLR-based and never uses Mono. Separately, set the SDK opt-out on the single Mono iOS simulator smoke test, which intentionally builds the product with Mono and therefore cannot turn UseMonoRuntime off. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Directory.Build.props | 3 +++ .../runtime-extra-platforms-ioslikesimulator.yml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 97e2d5ecacff0f..6686c890574a34 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -236,6 +236,9 @@ $([MSBuild]::NormalizePath('$(CoreClrProjectRoot)', 'nativeaot', 'System.Private.CoreLib', 'src', 'System.Private.CoreLib.csproj')) $([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'System.Private.Uri', 'src', 'System.Private.Uri.csproj')) + + false true $([MSBuild]::NormalizePath('$(CoreClrProjectRoot)', 'nativeaot', 'System.Private.CoreLib', 'src', 'System.Private.CoreLib.csproj')) $([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'System.Private.Uri', 'src', 'System.Private.Uri.csproj')) - - false + false true