NuGet has problems with missing packages, how to restore?(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 有丢失包的问题,如何恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:NuGet 有丢失包的问题,如何恢复?
基础教程推荐
- 如何激活MC67中的红灯 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- c# Math.Sqrt 实现 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01