Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An error occurred while trying to restore packages. Please try again

I am trying to restore the missing nuget packages and it keeps giving me this Error:

An error occurred while trying to restore packages. Please try again.

Any experience solving this? How can I find out what exactly is causing the error?

like image 296
user3311522 Avatar asked Mar 03 '14 17:03

user3311522


People also ask

How do I force a NuGet package to restore?

Enable package restore by choosing Tools > Options > NuGet Package Manager. Under Package Restore options, select Allow NuGet to download missing packages. In Solution Explorer, right click the solution and select Restore NuGet Packages.

How do I install a Nupkg file?

Menu Tools → Options → Package Manager Click OK. Drop your NuGet package files in that folder. Go to your Project in Solution Explorer, right click and select "Manage NuGet Packages". Select your new package source.

What is NuGet package?

Put simply, a NuGet package is a single ZIP file with the . nupkg extension that contains compiled code (DLLs), other files related to that code, and a descriptive manifest that includes information like the package's version number.


3 Answers

This is how I fix my issue:

First, I clear my Package Cache:

enter image description here

Second, I make sure I have the right path source and click the available package source:

enter image description here

like image 138
Willy David Jr Avatar answered Oct 12 '22 13:10

Willy David Jr


  1. Make sure you upgrade to the latest NuGet (http://docs.nuget.org/docs/start-here/installing-nuget).
  2. Make sure you're doing package restore "The Right Way" http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html

That should resolve the issue.

like image 31
Haacked Avatar answered Oct 12 '22 12:10

Haacked


If you don't want the package, just double-click your packages.config, find the line which refers to the package you want to get rid of, and delete that line.

Then, if you do want the package you could probably just redownload it using nuget and it'd probably resolve itself.

like image 10
Jared Beach Avatar answered Oct 12 '22 12:10

Jared Beach