-
Notifications
You must be signed in to change notification settings - Fork 4.2k
EnC: Track stale projects #78166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EnC: Track stale projects #78166
Conversation
Love it. Out of curiousity, does EnC log its decisions anywhere? |
src/Features/Core/Portable/EditAndContinue/CommittedSolution.cs
Outdated
Show resolved
Hide resolved
src/Features/Core/Portable/EditAndContinue/CommittedSolution.cs
Outdated
Show resolved
Hide resolved
Yes, Hot Reload output pane has the detailed logs if enabled in tools options. |
src/Features/Core/Portable/EditAndContinue/EditAndContinueDiagnosticDescriptors.cs
Show resolved
Hide resolved
|
Overall concept is great. I'm not qualified to know for certain if it is implemented properly :) |
| where TKey : notnull | ||
| { | ||
| #if NET | ||
| // .NET supports removing while enumerating: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, you're operating on IDictionary, not Dictionary here. so this is assume all IDictionaries support this.
Fixes Hot Reload in MAUI projects (or any projects that set
SingleTargetBuildForStartupProjectsmsbuild property).These projects only build the target that's being launched. Other targets are left stale.
EnC analyzer assumed that, unless something went wrong, the binaries of all projects that were built are up to date with the state of the solution. That's not the case in this scenario.
To fix the issue, we track stale projects along with committed solution. The committed solution is used during an edit session as a baseline for emitting module deltas.
Whenever the changes are successfully applied we set the committed solution to the current solution snapshot (of the main workspace).
When a document is changed during edit session we first check if we have a baseline document whose content matches the PDB, so that we can emit precise difference between the baseline and the current content.
If it does not, we consider the entire containing project stale. Any changes to a stale project or its documents are ignored until the project gets rebuilt.
The debugger recently added an API that's called whenever a project is rebuilt (
UpdateProjectBaseline). We remove the project from the stale list and update the status of all its documents in that call.Fixed issues:
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2442521
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2433992
dotnet/maui#27612
Follow up: