Please help me out on this one. What is the best approach? I try to give a simplified situation to describe my mental problem.
I have a solution with two projects: P1 and P2. I don't want every project to have a copy of required packages, because I have some base packages that every project will need because it sets up an environment for development.
I added next to my solution a NuGet.config file with the following content:
Now all installed packages end up in a folder Packages which is shared by all projects in my solution.
With project P1 selected I install package X which has an Init.ps1. The packages.config file in my project folder references package X.
Everytime I fire up my solution the Init.ps1 of package X executes, as exepected.
With project P1 selected I uninstall package X.
Package X is not removed from the Packages folder that is shared by all projects in my solution. The packages.config file in my project folder does not references package X anymore.
Everytime I fire up my solution the Init.ps1 of package X executes, which is not expected!
Shouldn't there be a reference count for packages? If no project references the package it is removed?