2016-11-20 134 views
1

拉出一些代码更新后,我发现我在构建时收到了此消息。某些NuGet包在Visual Studio应用程序中的解决方案中缺失

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 

在Solution Explorer与丢失的引用图标

显示的引用链接我删除了参考文献,然后在包管理器控制台的按钮出现,问我是否想安装缺少的包。但是,这并没有奏效。

+1

右键单击解决方案,恢复Nuget包。 – user3185569

+0

只需在NuGet命令行中键入restore? – Fang

+0

哎呀,我是右键点击该项目。当我右键点击解决方案时,该选项可用。 –

回答

0

当我尝试在解决方案之外自行打开项目并构建它时,我收到了该消息。

"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'. " 

我授予VS权限,然后我跑在包管理器控制台

update-package -Reinstall 
+1

感谢您分享您的答案。请标记您的答案,这对有相同问题的其他社区有益。 –

1

TT的可能是第一次下载过程中文件夹/拉链内容错误所以去Xamarin文件夹(C:/ User/YourName/AppData/Local/Xamarin)删除或重命名或移出丢失的nuget文件夹或zips文件夹的内容。重新启动IDE,您的IDE再次下载内容。我试试这个,它的工作。

+0

我没有使用xamarin –

1

点击Ctrl + Q并编写丢失包的名称,然后单击搜索在线NuGet包匹配。 它会显示菜单点击浏览,会给你缺少的软件包点击安装,卸载或更新。 enter image description here

相关问题