greenoldman
greenoldman

Reputation: 21072

How to successfully restore nuget packages for entire solution?

Let's say I have fetched fresh solution from the repository, so I get only source code + packages.config, but not packages themselves.

When I open this solution in VS2015 and check the references, those coming from nugets are broken (yellow sign). The property page for reference can look like this:

enter image description here

Fair enough. I click RMB on solution and select "Manage Nuget Packages for solution", then I select "all repositories" and click "restore" to restore packages.

All nuget packages are restored, I can see them in "installed" list, but references are still broken. And the property page does not change a bit.

To actually restore packages, I have to check "force uninstall" and then manually uninstall and install package after package. Only this restores packages.

Of course this is time consuming, so how to effectively and successfully restore packages with single click?

Upvotes: 1

Views: 2961

Answers (1)

greenoldman
greenoldman

Reputation: 21072

Thanks to @Matt Ward tip I solved this issue by first (literally) running command line and at it executing nuget restore my_solutions.sln and only then opening solution in Visual Studio.

Upvotes: 1

Related Questions