NuGet 有丢失包的问题,​​如何恢复?

NuGet has problems with missing packages, how to restore?(NuGet 有丢失包的问题,​​如何恢复?)
本文介绍了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 有丢失包的问题,​​如何恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)