Skip to content

Build mobile inner TFMs as CoreCLR in Mono host builds#130036

Merged
kotlarmilos merged 1 commit into
dotnet:mainfrom
kotlarmilos:dev/mono-mobile-coreclr
Jul 2, 2026
Merged

Build mobile inner TFMs as CoreCLR in Mono host builds#130036
kotlarmilos merged 1 commit into
dotnet:mainfrom
kotlarmilos:dev/mono-mobile-coreclr

Conversation

@kotlarmilos

@kotlarmilos kotlarmilos commented Jun 30, 2026

Copy link
Copy Markdown
Member

Description

When the runtime is built with a Mono-based SDK (for example the source-build validation leg), every project inherits UseMonoRuntime=true. The multi-targeted libraries also build their mobile target frameworks (-android, -ios, -tvos, -maccatalyst), and those inner builds pick up that same flag, so the SDK tries to use Mono for mobile and fails because mobile is CoreCLR-only in net11. This change turns UseMonoRuntime off for the mobile target frameworks so they always build as CoreCLR, even inside a Mono host build, which keeps the source-build Mono validation leg passing.

Scope UseMonoRuntime so the multi-targeted libraries' mobile target
frameworks build as CoreCLR even when the runtime is built with a
Mono-based SDK (e.g. the source-build Mono validation leg), where they
would otherwise inherit UseMonoRuntime=true and trip the SDK's
mobile-on-Mono check.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts repository-wide build properties so that when projects are multi-targeting mobile TFMs (e.g., net11.0-android, net11.0-ios) during a non-mobile build, UseMonoRuntime is forced to false, preventing those inner builds from selecting Mono runtime packs.

Changes:

  • Add a Directory.Build.props rule that flips UseMonoRuntime to false for *-android, *-ios, *-tvos, and *-maccatalyst target frameworks when TargetsMobile is not true.
Show a summary per file
File Description
Directory.Build.props Forces UseMonoRuntime=false for mobile inner TFMs during non-mobile builds to avoid pulling Mono runtime packs.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants