Some NuGet packages are missing from the solution

2019-06-27 02:15发布

After pulling some code updates I found I got this message when building.

Some NuGet packages are missing from the solution. 
The packages need to be restored in order to build the dependency graph. 
Restore the packages before performing any operations

In solution explorer the references links displayed with a missing reference icon

I deleted the references Then at the package manager console a button appeared asking if I wanted to install the missing packages. However, this did not work.

3条回答
乱世女痞
2楼-- · 2019-06-27 02:24

When I tried opening the project on its own , outside the solution, and buidling it I received the message.

One or more NuGet packages need to be restored but couldn't be because consent has not been granted. To give consent, open the Visual Studio Options dialog, click on the Package Manager node and check 'Allow NuGet to download missing packages during build.' You can also give consent by setting the environment variable 'EnableNuGetPackageRestore' to 'true'.

I granted VS the permission, then I ran at the package manager console

update-package -Reinstall  
查看更多
爷的心禁止访问
3楼-- · 2019-06-27 02:35

Click Ctrl+Q and write the name of the missing package and then click search for online NuGet package matching . It will show menu click on browse that will give you the missing package click install ,uninstall or update. enter image description here

查看更多
何必那么认真
4楼-- · 2019-06-27 02:44

It's possible that folder/zips content error during the first download so go to the Xamarin folder (C:/User/YourName/AppData/Local/Xamarin) and delete or rename or move out the folder of missing nuget or content the of zips folder.

Restart the IDE, your IDE download again the content. I tried this and it works.

查看更多
登录 后发表回答