恢复本地源不存在的 nuget 包时出现无法找到 nuget 本地源错误

编程入门 行业动态 更新时间:2024-10-23 17:37:13
本文介绍了恢复本地源不存在的 nuget 包时出现无法找到 nuget 本地源错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我获得了 Visual Studio 2017 解决方案.当我打开它时会出现错误:

I've been given a visual studio 2017 solution. When I open it fails as with the error:

还原 NuGet 包时出错:本地源\\network-location\"不存在.

我可以手动获取这些包的副本,但我不知道这个原始路径在哪里配置,以及如何将其更改为新位置.

I can manually acquire a copy of these packages but I don’t know where this original path is configured and how I would go about changing it to the new location.

有什么关于我应该去哪里看的建议吗?

Any suggestions as to where I should look please?

推荐答案

可以在 NuGet Package Manager 下的 Visual Studio 选项(Tools -> Options)中找到包源 ->包源 或直接通过单击 NuGet 对话框中的相应图标(解决方案/项目的上下文菜单 -> Manage NuGet Packages...):

The package sources can be found in the Visual Studio options (Tools -> Options) under NuGet Package Manager -> Package Sources or directly by clicking on the according icon in the NuGet dialog (context menu of a solution/project -> Manage NuGet Packages...):

您的本地包源应该会在以下对话框中列出:

Your local package source should then be listed in the following dialog:

但是,包源可能是特定于解决方案或项目的,因此可能会在解决方案目录中的 NuGet.config 文件中指定.从 NuGet 3.4 开始,Visual Studio 根据 NuGet.config 参考.直到 NuGet 3.3,还有名称为 .nuget 的子目录,用于搜索 NuGet.config 文件.

The package source may, however, be solution or project specific and may therefore be specified in a NuGet.config file in the solution directory. Beginning with NuGet 3.4, Visual Studio looks in the project's directory or "or any folder up to the drive root", according to the NuGet.config reference. Up to NuGet 3.3, also subdirectories with the name .nuget where searched for NuGet.config files.

必须更改包含本地包源的文件才能恢复正确的包.

The file containing your local package source must be changed in order to restore the correct packages.

更多推荐

恢复本地源不存在的 nuget 包时出现无法找到 nuget 本地源错误

本文发布于:2023-11-02 14:55:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1552696.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不存在   错误   nuget

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!