Skip to content

Implement support for changing project and package references #49611

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tmat
Copy link
Member

@tmat tmat commented Jul 1, 2025

Adding a package or project reference requires the following steps:

  1. Roslyn validating that the change is allowed (e.g. changing version of preexisting dependency is not allowed since we replace assembly that's already loaded with a new one).
  2. Roslyn determines which projects need redeployment and returns the set in ModuleUpdates (along with projects to rebuild/restart).
    Redeploying means copying dependencies that were added via package/project reference. These dlls are not present in output directory and need to be copied there.
    dotnet-watch executes ReferenceCopyLocalPathsOutputGroup target on these projects.
  3. At runtime the DotNetDeltaApplier needs to implement AssemblyResolving event that loads the new dependencies. These are not automatically loaded by the runtime since they were not present in the .deps.json file when the app launched.

TODO:

  • requires updated roslyn binaries

@github-actions github-actions bot added the Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch label Jul 1, 2025
Copy link
Contributor

Thanks for your PR, @@tmat.
To learn about the PR process and branching schedule of this repo, please take a look at the SDK PR Guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant