Hot Reload: Temporarily disable project-level analysis - #81729
Merged
Conversation
Member
Author
DustinCampbell
approved these changes
Dec 18, 2025
DustinCampbell
left a comment
Member
There was a problem hiding this comment.
The change looks good to me. 👍
Member
Author
|
/backport to release/insiders |
Contributor
|
Started backporting to |
2 tasks
tmat
added a commit
that referenced
this pull request
Jun 19, 2026
…ysis (#84161) Backport of #81729 to release/insiders Disable project change detection and reporting project-level rude edits until https://devdiv.visualstudio.com/DevDiv/_queries/edit/1835505 is implemented. When a solution is opened the following operations may take place: 1) Project is loaded, restored and DTB is kicked off. The Project System sends data to Roslyn to initialize Roslyn project from the results of DTB. 2) User hits F5/Ctrl+F5. 3) Debugger calls Roslyn to start Hot Reload session. Roslyn captures the current project state. 4) User hits "Apply Hot Reload" (either explicitly or implicitly through other debugger operations such as stepping). 5) Debugger tells Roslyn to apply changes. Roslyn compares the current project state with the state captured at (3). Currently, (2) and (3) may occur before (1) is complete. Roslyn Hot Reload then concludes changes were made to the project and reports rude edits or tries to apply them. These changes are just artifacts of Roslyn's project representation being updated by the Project System, not real changes made by the user. We need to block project launch until Roslyn projects are entirely initialized. Workaround for https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2606868 ## Customer Impact ## Regression - [x] Yes - [ ] No #79239 ## Testing No testing other than existing tests. The workaround is for a race condition between project system and Roslyn. Automated validation would require test infra that forces ordering of certain operations. ## Risk Medium. Not reporting rude edits for project changes might lead to applying incorrect deltas and corrupt the user application. That was however a possibility prior to #79239. Co-authored-by: tmat <tomas.matousek@microsoft.com>
akoeplinger
added a commit
to dotnet/sdk
that referenced
this pull request
Jul 2, 2026
dotnet/roslyn#81729 introduced AbstractEditAndContinueAnalyzer.EnableProjectLevelAnalysis (default false) and only sets it to true in the HotReloadService(HostWorkspaceServices, ...) constructor overload. dotnet-watch uses the other primary constructor (SolutionServices, Func<...>), so the flag stays false. This disables detection of project-level changes (e.g. newly added <ProjectReference>), causing hot reload to apply deltas against a stale project graph and the watched app to crash with FileNotFoundException on the missing dependency. Enable the flag via reflection until Roslyn sets it in both constructors.
Merged
2 tasks
akoeplinger
added a commit
to dotnet/sdk
that referenced
this pull request
Jul 7, 2026
dotnet/roslyn#81729 introduced AbstractEditAndContinueAnalyzer.EnableProjectLevelAnalysis (default false) and only sets it to true in the HotReloadService(HostWorkspaceServices, ...) constructor overload. dotnet-watch uses the other primary constructor (SolutionServices, Func<...>), so the flag stays false. This disables detection of project-level changes (e.g. newly added <ProjectReference>), causing hot reload to apply deltas against a stale project graph and the watched app to crash with FileNotFoundException on the missing dependency. Enable the flag via reflection until Roslyn sets it in both constructors. (cherry picked from commit 9a7cdc5)
tmat
added a commit
that referenced
this pull request
Jul 7, 2026
… of HotReloadService (#84422) Backport of #84404 to release/insiders /cc @tmat ## Customer Impact Breaks dotnet-watch. ## Regression - [x] Yes - [ ] No Regressed by #81729 ## Testing dotnet-watch tests ## Risk Low --------- Co-authored-by: Tomáš Matoušek <tmat@users.noreply.github.com>
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.
Disable project change detection and reporting project-level rude edits until https://devdiv.visualstudio.com/DevDiv/_queries/edit/1835505 is implemented.
When a solution is opened the following operations may take place:
Currently, (2) and (3) may occur before (1) is complete. Roslyn Hot Reload then concludes changes were made to the project and reports rude edits or tries to apply them. These changes are just artifacts of Roslyn's project representation being updated by the Project System, not real changes made by the user.
We need to block project launch until Roslyn projects are entirely initialized.
Workaround for https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2606868