NoImagination
NoImagination

Reputation: 186

Why Nuget doesn't restore packages from packages.config?

I have a project with packages.config file. As far as I know packages.config contains all installed packages in project (package will be in packages.config only if I installed it from nuget "store" but not manually (browse->select library)). And if I delete any library from references in solution explorer nuget must restore these libraries from packages.config, right? But my nuget doesn't do it. Why? Auto-restore activated in settings. I tried click on my solution->Restore Nuget Packages but output says there is nothing to restore. And no, I don't need Update-Package -Reinstall because it will overwrite older versions.

Upvotes: 0

Views: 2066

Answers (1)

NoImagination
NoImagination

Reputation: 186

As MattWard said

If you have deleted the references using Solution Explorer you have removed them from the project. A NuGet restore will not modify your project. It just puts back any NuGet packages that are missing from your solution's NuGet cache and the machine's NuGet package cache. If you have removed references you would need to use update-package -reinstall to add back the references you removed.

I accept it as an answer.

Upvotes: 2

Related Questions