Skip to content

[net11] PublishReadyToRunComposite=false fails to build on iOS with MSB3030 for every assembly #26456

Closed

Description

@MartinZikmund

Apple platform

iOS

Framework version

net11.0

Affected platform version

.NET SDK 11.0.100-preview.7.26381.103, Microsoft.iOS.Sdk.net11.0_26.5/26.5.11997-net11-p7, Xcode 26.5

Description

Setting PublishReadyToRunComposite=false — to get per-assembly ReadyToRun instead of a single composite image — makes the build fail. The R2R output-path fixup expects per-assembly .dylib files, but non-composite crossgen2 output is not produced at those paths, so the copy step fails for every assembly.

The build ends with 93 errors, the first being:

error MSB3030: Could not copy the file "obj/Release/net11.0-ios/iossimulator-x64/R2R/Microsoft.iOS.dylib" because it was not found.

raised from Microsoft.NET.Publish.targets via the iOS R2R path fixup (_FixR2ROutputPaths).

The same project builds cleanly with the default (PublishReadyToRunComposite unset, i.e. composite on), so this is specific to the non-composite path.

Context for why we tried it: composite R2R is producing a very large image for our app (see #26455), and per-assembly R2R was the natural thing to evaluate as an alternative. It appears the non-composite path is not currently wired up for iOS.

If per-assembly R2R is intentionally unsupported on iOS, it would help a lot if the property produced a clear diagnostic ("PublishReadyToRunComposite=false is not supported on iOS") rather than 93 file-not-found copy errors.

Steps to Reproduce

  1. Take any iOS app targeting net11.0.
  2. Build for the simulator in Release with composite explicitly disabled:
dotnet build -f net11.0-ios -c Release -p:PublishReadyToRunComposite=false
  1. Build fails with MSB3030: Could not copy the file "obj/Release/net11.0-ios/<rid>/R2R/<Assembly>.dylib" because it was not found., repeated once per assembly.

Reproduced on the Uno Platform samples app (~276 assemblies); the same project builds successfully in 2:55 with the property removed. Happy to produce a minimal standalone repro if that would help.

Did you find any workaround?

No workaround for getting per-assembly R2R on iOS. We stayed on composite R2R and addressed our size problem a different way (stripping the symbol table from the composite framework).

Activity

  1. rolfbjarne commented on Aug 27, 2026

    @rolfbjarne
    Member

    Thanks for the detailed report — I was able to reproduce this exactly (8 MSB3030 errors on a small test app instead of your 93).

    What's going on

    Non-composite ReadyToRun isn't wired up for iOS/tvOS/Mac Catalyst, and it can't be with the current runtime support. There are two layers to the failure:

    1. Our _FixR2ROutputPaths workaround rewrites OutputR2RImage to R2R/<Assembly>%(Extension), but for the non-composite compile list the item spec is the IL assembly, so crossgen2 was told to write R2R/<Assembly>.dll instead of the R2R/<Assembly>.o the SDK expects. The .dylib the publish step then wants to copy never exists — hence one MSB3030 per assembly.

    2. Fixing that isn't enough. With the Mach-O container format we use on these platforms, crossgen2 in non-composite mode emits one .o per assembly but no component IL assemblies, while the SDK replaces the IL assemblies in the publish output with the (per-assembly) dylibs — so the app would end up with no managed assemblies at all. And the runtime only knows how to find platform-native ReadyToRun code by looking up the owner composite image; see readytorun-platform-native-envelope.md, which states that Mach-O support is composite-only.

    So per-assembly R2R is genuinely unsupported here, not just unwired.

    What I changed

    Exactly what you asked for in the last paragraph of your report: a single, actionable error reported before crossgen2 even runs, instead of 93 file-not-found copy errors:

    error : Setting 'PublishReadyToRunComposite' to 'false' isn't supported for iOS projects,
    only composite ReadyToRun compilation is supported. Either remove the
    'PublishReadyToRunComposite' property, or set 'PublishReadyToRun=false' to turn off
    ReadyToRun compilation completely.
    

    I've also documented the property in docs/building-apps/build-properties.md and added a regression test. No standalone repro needed — thanks for offering though.

    Your composite size problem is tracked separately in #26455; per-assembly R2R unfortunately isn't an option to work around it right now.

  2. added
    enhancement
    on Aug 27, 2026
  3. added this to the .NET 11 milestone on Aug 27, 2026
  4. added a commit that references this issue on Sep 4, 2026
    ff54be8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions