Sam Leach
Sam Leach

Reputation: 12966

NuGet Package Restore Issue

I need NuGet to automatically restore packages. At the moment, the referenced dlls are missing.

I have enabled package restore on my solution.

The .nuget folder is checked in.

The packages.config file is checked in for each project.

The packages folder (on solution level) is check in.

The packages folder contains folders for all the packages the solution uses with nuspec and nupkg files for each package. The dll is not checked in.

In VisualStudio the packages are installed but the reference to the dll in each project is missing (ass the dll is not checked in).

I have tried to install NuGetPowerTools. Same story.

Thanks,

Upvotes: 1

Views: 2251

Answers (4)

Andrey Prokhorov
Andrey Prokhorov

Reputation: 919

I have got this problem in Visual Studio 2015 Update 3.

Found a solution that worked for me:

Went in to the user profile NuGet cache (C:\Users\<username>\.nuget\packages\), and deleted everything in there.

I think during the restore process my cache was cleared of all DLL files, and when I tried to install a package it was using the cache instead of the files off of NuGet. Now that I've cleared the cache, I can now install the NuGet packages.

Upvotes: 1

Xavier Decoster
Xavier Decoster

Reputation: 14810

There is no reason to check-in anything underneath the packages folder. Optionally, you can check in the repositories.config file but technically this is not required.

Do I get it right that you have checked-in the nuspec and nupkg files within the Packages folder? if so, delete them. These will be restored, and their presence might be causing restore failures (I don't think NuGet package restore is checking for the presence of the package contents, and rather checks for the presence of the nupkg/nuspec file in the Packages folder, skipping the package from being restored if found)

In summary, check in only:

  1. The empty solution level packages folder (optionally the repositories.config)
  2. .nuget folder and its contents
  3. packages.config for every project

Upvotes: 1

D.Kempkes
D.Kempkes

Reputation: 355

Same here, deleted config and re-referenced all the packages. Think it has something to do with SVN.

Upvotes: 0

flindeberg
flindeberg

Reputation: 5027

This is almost the same symptoms as I had once, and then the cause was the permission level on packages.config. Deleting the file solved it for me.

I have no idea if it will help you, but have a look at the permission sets for all the files.

Upvotes: 0

Related Questions