Reputation: 65371
I am doing a code review. We have started using Nuget to import 3rd party libraries, for example Enterprise Library.
Previously we had the dll's for Enterprise Library on a share that was accessed by all projects in the solution. When it was updated it was updated for all projects.
Now it is controlled by the packages.config which is a file per project. A change would mean changing several files, with a chance that not all files that should have been updated were updated.
Is there a way to share packages.config across projects, or a way to be able to updated all packages.config at the same time?
Upvotes: 0
Views: 1803
Reputation: 14810
Since you're doing a code review, allow me to say this: Enforcing package updates to its consumers is generally not a good practice.
Updating packages on the solution-level is the only way that ensures you the packages.config files will be updated as well (NuGet.exe update doesn't change these files).
packages.config files are project-related and can only be shared if all packages consumed by the projects are exactly the same. Add-as-link in the projects, update the repositories.config to point to the shared packages.config, and hope for the best (not sure whether NuGet checks for packages.config to be physically present in the project directory.
As you can see, this scenario is not mainstream and hence not supported in an optimal way.
Upvotes: 1
Reputation: 23980
In order to update packages in all the projects at the same time, you can launch the Manage NuGet Packages dialog at solution level (right click on the Solution).
Upvotes: 2