Skip to content

Add a config switch to fully disable hot-reload#123744

Merged
barosiak merged 18 commits intodotnet:mainfrom
barosiak:barosiak/issue-78540
Feb 19, 2026
Merged

Add a config switch to fully disable hot-reload#123744
barosiak merged 18 commits intodotnet:mainfrom
barosiak:barosiak/issue-78540

Conversation

@barosiak
Copy link
Member

Adds a config switch that unconditionally disables metadata updater.

Fixes #78540

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 29, 2026
@barosiak barosiak added enhancement Product code improvement that does NOT require public API changes/additions area-Diagnostics-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jan 29, 2026
@steveisok steveisok requested a review from a team January 29, 2026 01:39
Copilot AI review requested due to automatic review settings January 30, 2026 21:42
Copy link
Contributor

Copilot AI left a comment

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

@jkotas
Copy link
Member

jkotas commented Jan 30, 2026

Could you please check that this env variable can be used to fully disable hot reload under VS? (#78218 (comment) is the motivating feedback.)

@jkotas
Copy link
Member

jkotas commented Jan 30, 2026

cc @tmat

Copilot AI review requested due to automatic review settings February 2, 2026 20:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings February 12, 2026 23:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings February 13, 2026 23:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings February 17, 2026 21:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@barosiak
Copy link
Member Author

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

@barosiak barosiak marked this pull request as ready for review February 18, 2026 23:15
@barosiak barosiak enabled auto-merge (squash) February 18, 2026 23:40
@barosiak
Copy link
Member Author

/ba-g Converted from draft pr with no changes, no need to run another round of CI.

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

Labels

area-Diagnostics-coreclr enhancement Product code improvement that does NOT require public API changes/additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add config switch to fully disable hot-reload

5 participants

Comments