恢复本地源不存在的 nuget 包时出现无法找到 nuget 本地源错误 [英] Unable to find nuget local source error occurred while restoring nuget packages the local source doesn't exist

查看:289
本文介绍了恢复本地源不存在的 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 本地源错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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