11

I downloaded a Xamarin Solution from TFS and now need to restore the NuGet packages. I tried to do it like this :

Update-Package -reinstall -Project ProjectName

But it didn't work and I got this message:

This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.

enter image description here

How can I restore the NuGet packages? I tried to manually download android_m2repository, Clean Solution, delete bin/obj, rebuild - NOT WORKING, still :

An error occurred trying to install required android components on Project

UPD : I tried also Update-Package –reinstall - not worked :

This project references NuGet package(s) that are missing on this computer.

Сергей
  • 780
  • 4
  • 13
  • 31

5 Answers5

10

Right-click on the Solution and click Restore NuGet Packages

Or try running this command in the folder that has your solution file:

dotnet restore

Or

nuget restore
Iain Smith
  • 9,230
  • 4
  • 50
  • 61
  • when i did so, i got new error : `NuGet Package restore failed for project -myproject-: Unable to find version '1.0.39.113' of package..` – Сергей May 17 '18 at 13:32
  • Is that package in a private NuGet feed? If so you might need to get login details or access to the private NuGet feed – Iain Smith May 17 '18 at 13:34
  • 4
    I drop this package and Restore nuget : `All packages are already installed and there is nothing to restore.` but when I try to Build project get error again -> `This project references NuGet package(s) that are missing on this computer.` – Сергей May 17 '18 at 13:58
  • Since "All packages are already installed" what if you clean the solution, delete obj/bin folders, and Unload/reload projects? – VahidShir May 17 '18 at 16:30
  • dotnet restore works but nuget restore not. what is the difference? – Emil Aug 26 '19 at 20:16
  • As @Сергей Notes, none of these suggestions does anything at all. – 15ee8f99-57ff-4f92-890c-b56153 Jun 22 '20 at 17:20
1

I had similar issues once where it turned out that the Android SDK that was referenced was not installed. Maybe look in that direction?

JochemKempe
  • 2,566
  • 2
  • 16
  • 12
0

Package restore is primarily enabled through Tools > Options > NuGet Package Manager in Visual Studio: Check this Screenshot

  • This might help you.. check this thread. https://stackoverflow.com/questions/27895504/how-do-i-enable-nuget-package-restore-in-visual-studio?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa – phanikurla May 17 '18 at 13:22
  • Another way of fixing your issue: All you need to do is create a NuGet.Config file next to your .sln file, containing: – phanikurla May 17 '18 at 13:26
0

I just updated my Visual Studio 2017 from 15.6.4 to 15.7.2. It helped with packages, in my case.

Сергей
  • 780
  • 4
  • 13
  • 31
0

Hi You can remove the all nuget packages.for that select nuget and right click to remove it then go to app package and remove the Packages Folder then restart your visual studio and reinstall the Nuget Packages

It works for me

Thank You :)

logeshpalani31
  • 1,416
  • 12
  • 33