0

We would like to have one solution packages.config rather than individual packages.config at the project level. We have a rather large solution (over 300 projects) and we have had issues with project config like people forgetting to upgrade all projects to a specific version of a package. We realize that it will lock us to a single version of each package across all projects and we are ok with that. I've attempted do this to a few projects by deleting all packages in the project and then trying to re-add them through the solution rather than the project but its just re-adding the package.config at the project level. I even tried to manually delete the project level packages.config file and add them to the solution level and then using the solution level "manage nuget packages" dialog but the same thing happened.

I'm kind of going off this post which is quite old:
Manage packages at the solution level

coding4fun
  • 8,038
  • 13
  • 58
  • 85
  • You could have a look at https://stackoverflow.com/questions/43393822, the new `PackageReference` method of referencing nuget packages has more tooling possibilities than `packages.config` – Martin Ullrich Nov 21 '17 at 19:29

1 Answers1

0

Dependencies issues with multiple Project packages.config files in solution

You could not consume NuGet package for solution level with package.config. That because NuGet team deprecated solution level packages in NuGet 3.0. So you could not consume NuGet package for solution level with package.config.

Besides, you can use Manage NuGet Packages for Solution.. to manage the packages for all projects in the solution:

Right-click your solution > Manage NuGet Packages for Solution...

or

Tools > Library Package Manager > Manage NuGet Packages for Solution...

Then add it to all the projects by browsing for your package, then checking the top checkbox, and clicking install.

Or you can simple add following NuGet command line in the Package Manager Console:

Update-Package <package_name> -version 

This command line will update package for all projects.

If manage NuGet package at solution level is your persistence, you can consider Martin`s advice using PackageReference.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135