NuGet 有丢失包的问题,​​如何恢复? [英] NuGet has problems with missing packages, how to restore?

查看:35
本文介绍了NuGet 有丢失包的问题,​​如何恢复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试编译我的程序时,我收到以下错误:

When I try to compile my program I get the following error:

This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=317567.    

现在,当我右键单击解决方案并按

Now when I right click on the solution and press

All packages are already installed and there is nothing to restore.

我尝试手动重新安装每个未解决问题的软件包,我尝试重新安装 NuGet,但这也没有帮助,我什至尝试重新安装 Visual Studio.

I tried manually reinstalling every package which didn't solve the problem, I tried reinstalling NuGet but that didn't help either and I even tried reinstalling visual studio.

我还尝试从 tfs 文件夹中移动包文件夹以覆盖我的包文件夹,但这并没有解决任何问题.我还尝试在缺少此软件包的情况下重新下载它们,但这也没有解决问题.

I also tried moving the package folder from the tfs folder to overwrite my package folder but that didn't solve anything. I also tried redownloading them with this package missing, that didn' t solve the problem either.

有人知道如何恢复 nuget 包吗?

Anybody know how to restore the nuget packages?

推荐答案

使用 Visual Studio 中的 Package Manager Console 运行此命令.

Use Package Manager Console in Visual Studio to run this command.

1.这将从解决方案中恢复所有包

nuget restore YourSolution.sln

2.如果您想重新安装软件包到与以前相同的版本已安装

2.If you want to reinstall the packages to the same versions as were previously installed

Update-Package -reinstall

这篇关于NuGet 有丢失包的问题,​​如何恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆