nuget doesn't recognize installed packages

Viewed 27373

I have a C# project on Git that uses libraries from NuGet. Everything works fine, but when I pull on a fresh new machine and open the solution in Visual Studio it won't compile because of broken references. If I click on the references under the project I can see the classic warning sign with the yellow exclamation mark.

Nuget restore won't do anything (and I still haven't found any use of this feature...), files repositories.config are fine. If I right click on solution and then 'Manage NuGet packages for solution' no installed package is shown.

To this day I solved it this way: run

Install-Package package_name

it says:

'package_name' already installed.
My_project already has a reference to 'package_name'.

...and after that it shows the packages on the Manager, already assigned to the correct project.


NOTHING HAS BEEN CHANGED in the code ANYWHERE, I can see that because there are no differences on Git.

I have to do it only once on new machines, but it's really annoying. Any idea?


NuGet version: 2.8.60318.667


UPDATE 27/07

I tried the procedure from scratch on another PC, with windows 10, and everything works... same version of Visual Studio, NuGet, etc... I'm baffled

5 Answers

try removing your package from below nuget cache folder so that NUGET is forced to download from source

C:\Users\<< your user name >>\.nuget\packages

I experienced this issue today, and upgrading to the latest version of VS 2017 (15.8.7) didn't help at all.

Check your packages.config file(s) to see if your packages tag looks like this:

<packages xmlns="urn:packages">

If it does, remove the xmlns attribute so it's just:

<packages>

That fixed it for me!

Related