Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't restore NuGet Packages

Tags:

c#

nuget

xamarin

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.

like image 935
Сергей Avatar asked May 17 '18 13:05

Сергей


People also ask

How do I force a NuGet package to restore?

Restore NuGet packagesNavigate to Tools > Options > NuGet Package Manager > General, and then select the Allow NuGet to download missing packages check box under Package Restore. Enabling Restore NuGet Packages. In Solution Explorer, right-click the solution, and then select Restore NuGet Packages.

How do I install NuGet packages missing?

To do that, go to Tools, NuGet Packaged Manager, then go to Package Manager Settings. Go to the General section, and then make sure you have a checkmark for Allow NuGet to download missing packages and also to automatically check for missing packages during the build in Visual Studio.

Does dotnet restore NuGet packages?

Description. The dotnet restore command uses NuGet to restore dependencies as well as project-specific tools that are specified in the project file.

What is the difference between NuGet restore and dotnet restore?

nuget restore will ensure all of your NuGet dependencies are downloaded and available to your project. Whereas dotnet restore is a complete restoration of all NuGet dependencies as well as references and project specific tools. Meaning that if you run nuget restore , you are only restoring NuGet packages.


2 Answers

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
like image 87
Iain Smith Avatar answered Oct 01 '22 09:10

Iain Smith


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

like image 26
JochemKempe Avatar answered Oct 01 '22 09:10

JochemKempe