Skip to content

EnC: support for partial solution updates #78244

@tmat

Description

@tmat

Scenario:

  • Solution with 2 independent projects: A, B.
  • Launch both projects.
  • Make change in project A that's a valid update.
  • Make change in project B that's a rude edit

We block both updates due to the rude edit. Both A and B have to be restarted, otherwise we would get to an inconsistent state.

Similarly, if B has no-effect edit (instead of a rude edit) and the project is configured to be restarted on no-effect edits. We would need to restart both A and B.

New protocol for the host:

  1. Call GetUpdatesAsync
  2. If any projects listed in ProjectsToRestart returned from [1] do not allow auto-restart (HotReloadAutoRestart property) and the user previously did not opted into always auto-restarting, show the rude edit dialog. If user chooses to not restart, bail and call DiscardUpdatesAsync.
  3. Try to apply all updates returned by GetUpdatesAsync. If this fails, call DiscardUpdatesAsync and bail. Do not attempt to restart any projects.
  4. Call CommitUpdatesAsync().
  5. Proceed with restarting projects:
    a) Terminate all processes associated with projects in ProjectsToRestart set.
    b) Rebuild all projects listed in ProjectsToRebuild. If build fails (e.g. compilation error) ask user to fix them. If the user tries to continue run build of these projects again. Only allow EnC/Hot Reload session to continue if the build succeeds.
    c) Re-launch all projects listed in ProjectsToRestart.
VS blocked on https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2459003

UPDATE to account for deployment:

  1. Call GetUpdatesAsync
  2. If any projects listed in ProjectsToRestart returned from [1] do not allow auto-restart (HotReloadAutoRestart property) and the user previously did not opted into always auto-restarting, show the rude edit dialog. If user chooses to not restart, bail and call DiscardUpdatesAsync.
  3. Call CommitUpdatesAsync().
  4. Terminate all processes associated with projects in ProjectsToRestart set.
  5. Rebuild all projects listed in ProjectsToRebuild. If build fails (e.g. compilation error) ask user to fix them. If the user tries to continue attempt building these projects again. Only allow EnC/Hot Reload session to continue if the build succeeds.
  6. Deploy dependencies of projects listed in ProjectsToRedeploy.
  7. Apply all updates returned by GetUpdatesAsync. If this operation fails in any process, the process is in a potentially corrupt state and can accept no further updates.
  8. Re-launch all projects listed in ProjectsToRestart.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions