Add a config switch to fully disable hot-reload#123744
Add a config switch to fully disable hot-reload#123744barosiak merged 18 commits intodotnet:mainfrom
Conversation
src/libraries/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
This PR adds a configuration switch to fully disable hot-reload by introducing a new "none" value for the DOTNET_MODIFIABLE_ASSEMBLIES environment variable. This addresses issue #78540 where hot-reload couldn't be disabled when it was causing bugs, particularly when a debugger was attached.
Changes:
- Introduced a tri-state enum (UNSET, NONE, DEBUG) to distinguish between "not configured", "explicitly disabled", and "explicitly enabled"
- Updated both Mono and CoreCLR implementations to recognize the "none" value
- Added test coverage for the new disable functionality
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/mono/mono/metadata/metadata-update.h | Updated enum to add UNSET/NONE/DEBUG states with new numbering |
| src/mono/mono/component/hot_reload.c | Added "none" value handling and updated logic (contains critical bug) |
| src/mono/mono/component/hot_reload-stub.c | Updated stub to use UNSET instead of NONE for uninitialized state |
| src/mono/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs | Minor whitespace fix |
| src/libraries/System.Runtime.Loader/tests/ApplyUpdateUtil.cs | Added constant for disabled value |
| src/libraries/System.Runtime.Loader/tests/ApplyUpdateTest.cs | Added test for disable functionality |
| src/coreclr/vm/eeconfig.h | Updated enum definition and method signatures for new tri-state |
| src/coreclr/vm/eeconfig.cpp | Added parsing logic for "none" value |
| src/coreclr/vm/ceeload.cpp | Updated condition to use new enum |
| src/coreclr/vm/assemblynative.cpp | Updated logic to check for explicit disable |
src/mono/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs
Outdated
Show resolved
Hide resolved
|
Could you please check that this env variable can be used to fully disable hot reload under VS? (#78218 (comment) is the motivating feedback.) |
|
cc @tmat |
|
/ba-g Known issues + a timeout caused by 200+ items in "waiting" state sent to Helix, unrelated to this pr. No need to run another round of CI. |
|
/ba-g Converted from draft pr with no changes, no need to run another round of CI. |
Adds a config switch that unconditionally disables metadata updater.
Fixes #78540