Reset Hot Reload _disabled flag when a new debug session starts#83747
Open
noiseonwires wants to merge 1 commit into
Open
Reset Hot Reload _disabled flag when a new debug session starts#83747noiseonwires wants to merge 1 commit into
noiseonwires wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Resets the Managed Hot Reload service’s _disabled flag on each new debug session so prior session failures don’t permanently disable Hot Reload.
Changes:
- Removed the early-return when
_disabledis set at session start. - Added logic to always reset
_disabledtofalseat the beginning ofStartSessionAsync, with explanatory comments.
2532755 to
81bb815
Compare
tmat
approved these changes
May 18, 2026
dibarbet
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ManagedHotReloadLanguageServiceImpl._disabledis set to true whenever an unexpected exception is caughtStartSessionAsync,BreakStateOrCapabilitiesChangedAsync,EndSessionAsync. Once set, the flag is never cleared -EndSessionAsyncdoes not reset it andStartSessionAsyncearly-returns when it is true. This means a single failure permanently disables Hot Reload for the lifetime of the Roslyn process, even across debug session restarts. Users have to restart Visual Studio / the Roslyn LSP server to recover.As discussed with @tmat some time ago, this change clears
_disabledat the start ofStartSessionAsyncso that a fresh debug session is always given a chance to initialize. Any exception that flipped the flag is still a product bug worth fixing on its own, but this avoids a confusing and unrecoverable user-facing state where Hot Reload silently does nothing for the rest of the IDE session.Investigated as part of a report where Hot Reload worked exactly once per Roslyn process and then stopped responding until the process was restarted.
Microsoft Reviewers: Open in CodeFlow