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

NoImagination

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.

NoImagination

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Can't restore NuGet Packages

nuget.exe doesn't restore all packages

Nuget doesn't restore packages for solution, but works when executed for .csproj

TFS on premise can't restore nuget packages from private feed

NuGet can't restore packages behind the proxy

Failure to restore nuget packages from organisation feed

Artifactory restore nuget packages with authentication from powershell

Nuget does not restore packages from source control

AzureDevOps doesn't restore packages from AzureDevOps feed

Local source of nuget packages doesn't exist

Why doesn't GCJ find the classes from my imported packages?

Why ReSharper doesn't add NuGet packages when it suggests to reference them?

Why does SetBasePath not work in .NET Core 3.1? I've tried adding nuget packages, but it doesn't work

Nuget - Declare NuGet PackageSource in packages.config

can't find nuget packages from nuget server

C# Programmatically Restore NuGet Packages

TeamCity Build Server cannot restore nuget packages

Cant restore nuget packages in framework 4.7.2

How to successfully restore nuget packages for entire solution?

NuGet Restore Failing to See that Packages are not Installed

Nuget Packages Restore issue in Bamboo with MSBuild

.Net Core project Nuget Packages Can not restore

Visual Studio NuGet Cannot Restore Packages

Nuget VS 2015 Update 2 Doesn't Find All Packages

Why am I unable to remove nuget packages from a .NET project?

Installing multiple nuget packages by manually editing the packages.config

How to read the list of NuGet packages in packages.config programatically?

adding nuget packages in TFS - does packages.config need to be Checked In?

How to restore NuGet packages in Visual Studio without a full NuGet reinstall