-
Notifications
You must be signed in to change notification settings - Fork 224
Updating search path in global.json won't invalidate lock in case where a package reference can change to a project reference. #2671
Comments
Did dependencies change? /cc @anurse Could this be a caching bug? Do we still have the same cache dependencies as when we were caching the ApplicationHost context? |
Dependencies doesn't change, just adds a search path in |
Yeah, it's a regression from beta7. I'll investigate after lunch. |
/cc @davidfowl @PradeepKadubandi After recent runtime refractory the dependency resolving now purely depends on the lock file. The lock file is not updated in this case, therefore updating global.json won't update the dependencies of projects. There are a few solutions. One is to make VS restore every project when search paths are changed in global.json. This solution doesn't require runtime change and also align with the usage of DNX at runtime. However, design time takes performance hit when global.json is updated. It is not idea for large solution like MVC. The other idea is to adding communicate message between DTH and VS. Whenever search paths are updated VS asks DTH to advise if a restore is needed. Internally DTH can scan through the project.json and map the dependencies then comparing to the lock file. This solution requires change in DTH and also add new feature to DTH protocol. The last solution is to partially walk back the runtime refractory. In addition to lock file, a list of projects in search paths is listed. For every dependencies read from the lock file a quick query can be made against the list so as to know if the lock file is invalid. This logic can be triggered for design time only. |
Ping @davidfowl |
We're going to need to force a restore in this case so that the lock files update |
Thanks @PradeepKadubandi. I'll close this issue as it doesn't need work on runtime side. |
I have some second thoughts about this. |
Per discussion with @davidfowl, we decide to reopen this issue and explore a new solution. We can log the search paths (from global.json) in lock file. As a result, we can invalidate the lock file when global.json is updated. It helps tooling mitigate the performance hit. And also make the console solution more reliable. |
New solution:
|
Fixed in 5066768 |
I showed Troy the issue.
When we send 'RefreshDependencies' message to DTH, we are not getting the dependency message back. This is the log from DTH events:
The text was updated successfully, but these errors were encountered: