Build mobile inner TFMs as CoreCLR in Mono host builds#130036
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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.propsrule that flipsUseMonoRuntimetofalsefor*-android,*-ios,*-tvos, and*-maccatalysttarget frameworks whenTargetsMobileis nottrue.
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
vitek-karas
approved these changes
Jun 30, 2026
This was referenced Jul 1, 2026
Open
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 turnsUseMonoRuntimeoff 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.