Skip to content

[net11.0] Make CoreCLR the default runtime.#25050

Draft
rolfbjarne wants to merge 15 commits intonet11.0from
dev/rolf/coreclr-default
Draft

[net11.0] Make CoreCLR the default runtime.#25050
rolfbjarne wants to merge 15 commits intonet11.0from
dev/rolf/coreclr-default

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the shared MSBuild props for Apple .NET SDK builds to make CoreCLR the default runtime by changing the default value of UseMonoRuntime.

Changes:

  • Set UseMonoRuntime to default to false when unspecified (making CoreCLR the default runtime selection).
  • Remove previous conditional defaults that set Mono as the default except for macOS / NativeAOT publishing.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Copy link
Copy Markdown
Member

@dalexsoto dalexsoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

rolfbjarne and others added 11 commits April 1, 2026 17:10
Update CheckAppBundleContents to accept an isCoreCLR parameter so it can
correctly filter CoreCLR-specific runtime files on all platforms (not just
macOS). This includes:

- CoreCLR/Mono dylib filtering based on isCoreCLR instead of platform
- Framework-packaged native libraries on iOS/tvOS (libcoreclr.framework, etc.)
- R2R compiled app artifacts (.r2r.dylib, BundleStructure.framework)
- libxamarin-dotnet-coreclr bridge libraries
- Per-rid assembly layout for CoreCLR on MacCatalyst multi-rid builds

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix a typo where UseMonoRuntime was always set to 'true' regardless
of the useMonoRuntime parameter, so CoreCLR tests were never actually
testing CoreCLR.

Update assertions for CoreCLR:
- Filter out .framework/_CodeSignature entries from the 'no other
  signed app bundles' check - on iOS/tvOS, CoreCLR packages native
  runtime libraries as signed .framework bundles.
- Exclude dylibs directly in the assembly directory from the 'must be
  unsigned' check - on macOS/MacCatalyst, CoreCLR native runtime dylibs
  (libcoreclr.dylib, libSystem.*.dylib, etc.) are signed and should not
  be part of the customized code signing assertions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When CoreCLR is the default runtime, iOS/tvOS builds enable R2R
compilation (CreateR2RFramework=true, CreateR2RDylib=true). The
_CreateR2RFramework and _CreateR2RDylib targets invoke native toolchain
tasks (CompileAppManifest, LinkNativeCode) that require Xcode/Mac SDK
tools.

When IsMacEnabled=false (simulating a Windows build environment), the
Mac SDK is unavailable and _SdkVersion is empty, causing the
CompileAppManifest task to fail with a missing parameter error.

Add 'And $(IsMacEnabled) != false' to the conditions of both targets to
skip R2R framework/dylib creation when building without Mac tools.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Follow the same pattern as BundleStructureTest: split the public test
method into IsNotMacBuild_Mono and IsNotMacBuild_CoreCLR, each calling
a private IsNotMacBuild() helper that accepts a useMonoRuntime flag.

The UseInterpreter=true test case is only included in the Mono variant
since the interpreter is a MonoVM-specific feature.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CoreCLR builds link against additional native runtime libraries:
- On iOS/tvOS: @rpath/libcoreclr.framework/libcoreclr and friends,
  plus the R2R framework (@rpath/MySimpleApp.framework/MySimpleApp)
- On macOS/MacCatalyst: @executable_path/.../libcoreclr.dylib and friends,
  plus the R2R dylib (MySimpleApp.r2r.dylib)

CoreCLR None builds are also missing CryptoKit compared to MonoVM,
since CoreCLR's BCL doesn't reference it.

macOS is CoreCLR-only (no Mono variant), so it's only in _CoreCLR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extract shared coreclrFrameworks_iOS/tvOS/MacCatalyst arrays with the
CoreCLR runtime library entries. Rename the _Mono base arrays to have no
suffix (common to both runtimes), then build the _Mono and _CoreCLR
variants using spread expressions:

  _None_Mono = [.. base_None, CryptoKit]
  _None_CoreCLR = [.. coreclrFrameworks, .. base_None]
  _Full_Mono = base_Full (alias)
  _Full_CoreCLR = [.. coreclrFrameworks, .. base_Full]

This removes ~530 lines of duplicated framework lists.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Makes future diffs easier to read when frameworks are added or removed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

Copy link
Copy Markdown
Member

@dalexsoto dalexsoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀🚀

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

rolfbjarne and others added 3 commits April 3, 2026 09:54
…CoreCLR test variants

The R2R framework properties (_R2RFrameworkName, _R2RFrameworkPath, etc.)
were declared inside the _PrepareR2RFrameworkCreation target, so they were
only available after that target ran. In multi-RID outer builds
(RuntimeIdentifiers=ios-arm64), _PrepareR2RFrameworkCreation never executes
because CreateReadyToRunImages dispatches to inner builds. This left
_R2RFrameworkName empty in the outer build context.

_CollectR2RFrameworksForPostProcessing uses _R2RFrameworkName to populate
the post-processing item list for dsymutil/strip. With an empty name it
produced a path like 'Frameworks/.framework/', causing dsymutil to fail:
'cannot parse the debug map: No such file or directory'.

Fix: move all R2R framework PropertyGroup declarations to a static
PropertyGroup outside any target in Microsoft.Sdk.R2R.targets.
DeviceSpecificIntermediateOutputPath is stable at evaluation time (set in
Xamarin.Shared.props and not overridden in the .NET SDK targets), and
AssemblyName is always available, so all derived properties are computed
correctly in both inner builds and multi-RID outer builds.

Also split PluralRuntimeIdentifiers and PluralRuntimeIdentifiersWithRemoteMac
into _Mono and _CoreCLR test variants so both runtimes are covered explicitly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
With CoreCLR, C# changes don't trigger native re-linking because R2R
output is a separate framework (not an input to _LinkNativeExecutable).
This is different from MonoVM behavior where AOT .o files are linked
into the native executable.

Split CodeChangeSkipsTargets and CodeChangeSkipsTargetsOnRemoteWindows
into _Mono and _CoreCLR variants to handle this difference.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
With CoreCLR (R2R), assemblies retain their IL bodies — they are not
stripped the way MonoVM AOT strips method bodies. Split BuildIpaTest
into _Mono and _CoreCLR variants and pass shouldStrip accordingly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #59d0ab4] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 59d0ab47f5c203b63cf0a1d9a758b975819610fe [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 59d0ab47f5c203b63cf0a1d9a758b975819610fe [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #59d0ab4] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 59d0ab47f5c203b63cf0a1d9a758b975819610fe [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #59d0ab4] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 59d0ab47f5c203b63cf0a1d9a758b975819610fe [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

🔥 [CI Build #59d0ab4] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

5 tests crashed, 6 tests failed, 93 tests passed.

Failures

❌ dotnettests tests (MacCatalyst)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.IncrementalBuildTest.Interpreter(MacCatalyst,"macc...: Modified B
      Expected: 2026-04-03 12:45:57.9291252
      But was: 2026-04-03 12:46:00.5464587

    • Xamarin.Tests.IncrementalBuildTest.Link(MacCatalyst,"maccatalyst...: Modified C
      Expected: 2026-04-03 12:46:17.4812982
      But was: 2026-04-03 12:46:19.0319254

    • Xamarin.Tests.PostBuildTest.PublishTest(MacCatalyst,"maccatalyst...: 'dotnet publish' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-11.0.100...

Html Report (VSDrops) Download

❌ monotouch tests (iOS)

🔥 Failed catastrophically on VSTS: test results - monotouch_ios (no summary found).

Html Report (VSDrops) Download

❌ monotouch tests (MacCatalyst)

🔥 Failed catastrophically on VSTS: test results - monotouch_maccatalyst (no summary found).

Html Report (VSDrops) Download

❌ monotouch tests (macOS)

🔥 Failed catastrophically on VSTS: test results - monotouch_macos (no summary found).

Html Report (VSDrops) Download

❌ monotouch tests (tvOS)

🔥 Failed catastrophically on VSTS: test results - monotouch_tvos (no summary found).

Html Report (VSDrops) Download

❌ windows tests

1 tests failed, 2 tests passed.

Failed tests

  • Remote .NET tests/Xamarin.Tests.WindowsTest.BundleStructureWithRemoteMac(iOS,"ios-arm64",All,"Debug"): Failed: No unexpected files

Html Report (VSDrops) Download

❌ xcframework tests

2 tests failed, 2 tests passed.

Failed tests

  • xcframework-test/iOS - simulator/Debug: HarnessException (Harness exception for 'xcframework-test': System.Net.Sockets.SocketException (49): Can't assign requested address
    at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName)
    at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
    at System.Net.Sockets.Socket.Bind(EndPoint localEP)
    at System.Net.Sockets.TcpListener.Start(Int32 backlog)
    at Microsoft.DotNet.XHarness.iOS.Shared.Listeners.SimpleTcpListener.InitializeAndGetPort()
    at Xharness.AppRunner.RunAsync() in /Users/builder/azdo/_work/1/s/macios/tests/xharness/AppRunner.cs:line 250
    at Xharness.Jenkins.TestTasks.RunSimulator.RunTestAsync() in /Users/builder/azdo/_work/1/s/macios/tests/xharness/Jenkins/TestTasks/RunSimulator.cs:line 123
    at Xharness.Jenkins.TestTasks.RunTest.ExecuteAsync() in /Users/builder/azdo/_work/1/s/macios/tests/xharness/Jenkins/TestTasks/RunTest.cs:line 113
    at Xharness.Jenkins.TestTasks.TestTasks.RunInternalAsync() in /Users/builder/azdo/_work/1/s/macios/tests/xharness/Jenkins/TestTasks/TestTask.cs:line 234)
  • xcframework-test/tvOS - simulator/Debug: HarnessException (Harness exception for 'xcframework-test': System.Net.Sockets.SocketException (49): Can't assign requested address
    at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, Boolean disconnectOnFailure, String callerName)
    at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
    at System.Net.Sockets.Socket.Bind(EndPoint localEP)
    at System.Net.Sockets.TcpListener.Start(Int32 backlog)
    at Microsoft.DotNet.XHarness.iOS.Shared.Listeners.SimpleTcpListener.InitializeAndGetPort()
    at Xharness.AppRunner.RunAsync() in /Users/builder/azdo/_work/1/s/macios/tests/xharness/AppRunner.cs:line 250
    at Xharness.Jenkins.TestTasks.RunSimulator.RunTestAsync() in /Users/builder/azdo/_work/1/s/macios/tests/xharness/Jenkins/TestTasks/RunSimulator.cs:line 123
    at Xharness.Jenkins.TestTasks.RunTest.ExecuteAsync() in /Users/builder/azdo/_work/1/s/macios/tests/xharness/Jenkins/TestTasks/RunTest.cs:line 113
    at Xharness.Jenkins.TestTasks.TestTasks.RunInternalAsync() in /Users/builder/azdo/_work/1/s/macios/tests/xharness/Jenkins/TestTasks/TestTask.cs:line 234)

Html Report (VSDrops) Download

❌ xtro tests

🔥 Failed catastrophically on VSTS: test results - xtro (no summary found).

Html Report (VSDrops) Download

❌ Tests on macOS Sequoia (15) tests

1 tests failed, 4 tests passed.

Failed tests

  • monotouch-test: Failed (exit code 2)
    • No test failure details available. stderr output:
      • 2026-04-03 06:13:26.452 monotouchtest[93940:7575081] [PASS] VeryGeneric
      • 2026-04-03 06:13:26.453 monotouchtest[93940:7575081] [PASS] WrapperTypeLookupTest
      • 2026-04-03 06:13:26.453 monotouchtest[93940:7575081] Xamarin.Tests.RuntimeTest : 509.7754 ms
      • 2026-04-03 06:13:26.453 monotouchtest[93940:7575081] Xamarin.Tests : 509.8028 ms
      • 2026-04-03 06:13:26.453 monotouchtest[93940:7575081] Xamarin : 517.6199 ms
      • 2026-04-03 06:13:26.454 monotouchtest[93940:7575081] bindings-test : 517.6468 ms
      • 2026-04-03 06:13:26.463 monotouchtest[93940:7573926] Tests run: 3552 Passed: 3542 Inconclusive: 10 Failed: 0 Ignored: 189
      • 2026-04-03 06:13:26.464 monotouchtest[93940:7573926] AutoRun (): completed test run on main thread
      • 2026-04-03 06:13:26.464 monotouchtest[93940:7573926] Exiting test run with success
      • make: *** [exec-monotouch-test] Error 1

Html Report (VSDrops) Download

❌ Tests on macOS Tahoe (26) tests

1 tests failed, 4 tests passed.

Failed tests

  • monotouch-test: Failed (exit code 2)
    • No test failure details available. stderr output:
      • 2026-04-03 06:14:26.654 monotouchtest[17973:8020031] [PASS] VeryGeneric
      • 2026-04-03 06:14:26.654 monotouchtest[17973:8020031] [PASS] WrapperTypeLookupTest
      • 2026-04-03 06:14:26.655 monotouchtest[17973:8020031] Xamarin.Tests.RuntimeTest : 338.8501 ms
      • 2026-04-03 06:14:26.655 monotouchtest[17973:8020031] Xamarin.Tests : 338.8671 ms
      • 2026-04-03 06:14:26.655 monotouchtest[17973:8020031] Xamarin : 346.8984 ms
      • 2026-04-03 06:14:26.655 monotouchtest[17973:8020031] bindings-test : 346.9183 ms
      • 2026-04-03 06:14:26.664 monotouchtest[17973:8019074] Tests run: 3611 Passed: 3601 Inconclusive: 10 Failed: 0 Ignored: 130
      • 2026-04-03 06:14:26.664 monotouchtest[17973:8019074] AutoRun (): completed test run on main thread
      • 2026-04-03 06:14:26.664 monotouchtest[17973:8019074] Exiting test run with success
      • make: *** [exec-monotouch-test] Error 1

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 9 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 59d0ab47f5c203b63cf0a1d9a758b975819610fe [PR build]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants