Skip to content

[net11.0] [dotnet] Set DOTNET_MODIFIABLE_ASSEMBLIES environment variable for CoreCLR - #25870

Merged
rolfbjarne merged 5 commits into
net11.0from
dev/matouskozk/set-modifiable-assemblies-env-var
Jun 30, 2026
Merged

rolfbjarne merged 5 commits into
net11.0from
dev/matouskozk/set-modifiable-assemblies-env-var

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

When using the interpreter with CoreCLR runtime, set DOTNET_MODIFIABLE_ASSEMBLIES=debug environment variable in the generated main.m. This enables hot reload and modifiable assemblies support for CoreCLR on iOS.

Cherry-picked from thaystg/xamarin-macios@38db4b5899 (dev/thays/set_modifiable_assemblies_env_var).

Recreation of #25864 (from @matouskozak) beacuse we can't build PRs from forks.

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 updates the generated main.mm initialization code so that DOTNET_MODIFIABLE_ASSEMBLIES=debug is set not only for MonoVM+interpreter scenarios, but also when using the CoreCLR runtime (when managed debug symbols are packaged). This enables modifiable assemblies / hot reload support for CoreCLR-based iOS apps.

Changes:

  • Expand the condition for emitting setenv ("DOTNET_MODIFIABLE_ASSEMBLIES", "debug", 1); to include XamarinRuntime.CoreCLR.
  • Keep the existing behavior for interpreter builds (MonoVM) gated on PackageManagedDebugSymbols.

@rolfbjarne
rolfbjarne enabled auto-merge (squash) June 30, 2026 06:30
@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.

@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.

@matouskozak

matouskozak commented Jun 30, 2026 •

Copy link
Copy Markdown
Member

Is Configuration.Application.UseInterpreter only true for Mono Interpreter? Seems like we could simplify it even more if it would cover both Mono and CoreCLR interpreter.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #12252a9] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 12252a929e4cc618d93f793648a853e6011a9be1 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@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: 12252a929e4cc618d93f793648a853e6011a9be1 [PR build]

@kotlarmilos
kotlarmilos self-requested a review June 30, 2026 07:58
@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne

Copy link
Copy Markdown
Member Author

Is Configuration.Application.UseInterpreter only true for Mono Interpreter? Seems like we could simplify it even more if it would cover both Mono and CoreCLR interpreter.

Yes. We'll remove Configuration.Application.UseInterpreter completely once we clean up code after removing support for Mono.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #12252a9] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 12252a929e4cc618d93f793648a853e6011a9be1 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #12252a9] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 12252a929e4cc618d93f793648a853e6011a9be1 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #12252a9] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 208 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): 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 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 21 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 18 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 18 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Sonoma (14): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download

Linux Build Verification

✅ Linux build succeeded

Pipeline on Agent
Hash: 12252a929e4cc618d93f793648a853e6011a9be1 [PR build]

@rolfbjarne
rolfbjarne merged commit a68c5c0 into net11.0 Jun 30, 2026
56 checks passed
@rolfbjarne
rolfbjarne deleted the dev/matouskozk/set-modifiable-assemblies-env-var branch June 30, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants