Skip to content

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
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@steveisok steveisok requested a review from a team January 29, 2026 01:39
/// or the System.Reflection.Metadata.HotReloadDisabled AppContext switch set to true.
/// </summary>
internal static bool IsHotReloadDisabled =>
AppContextConfigHelper.GetBooleanConfig("System.Reflection.Metadata.HotReloadDisabled", "DOTNET_HOTRELOAD_DISABLED");
Copy link
Member

@jkotas jkotas Jan 29, 2026

Choose a reason for hiding this comment

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

This should not be called HotReload. HotReload is the larger Visual Studio feature. The name of the runtime sub-feature is metadata updater. Can this be called System.Reflection.Metadata.MetadataUpdater.IsSupported same name as the switch used for trimming MetadataUpdater support via FeatureSwitchDefinition?

/// Returns true if hot reload is explicitly disabled via the DOTNET_HOTRELOAD_DISABLED environment variable
/// or the System.Reflection.Metadata.HotReloadDisabled AppContext switch set to true.
/// </summary>
internal static bool IsHotReloadDisabled =>
Copy link
Member

@jkotas jkotas Jan 29, 2026

Choose a reason for hiding this comment

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

We have DOTNET_MODIFIABLE_ASSEMBLIES environment variable that is mean to control the set updateable assemblies. Currently, the only valid value is debug that makes all assemblies compiled as debug modifiable. Would it work to extend this env variable - e.g. recognize none as a value that makes all assemblies unmodifiable and thus disables metadata updater?

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

2 participants