nuget - 有没有办法配置 NuGet 以忽略不可用的包源?

标签 nuget

在 Visual Studio 2017 中进行开发时,我使用标准 NuGet 包源和我工作的公司的包源的组合。

要访问这些公司包源,我必须连接到我们公司的 VPN。

不幸的是,这意味着我必须始终连接到我们公司的 VPN,无论我正在开发什么,否则 NuGet 会给我这样的:

Exception 'System.AggregateException' thrown when trying to add source 'http://[one of my company's package sources]'. Please verify all your online package sources are available. One or more errors occurred. Unable to load the service index for source http://[one of my company's package sources]. An error occurred while sending the request. The remote name could not be resolved: '[one of my company's package sources]'



如果我尝试使用仅托管在我公司服务器上的软件包,这将是有意义的。但即使我专门将包源下拉列表设置为 nuget.org,我也会收到此错误。

有一个问题需要修复,但它已经使用了两年并且没有任何事件迹象:install fails when a nuget Source is unavailable even when this is not the selected Source #2614

那么,有没有办法以某种方式配置 NuGet 以忽略丢失的包源?

最佳答案

如解释 in this answer ,Visual Studio 2017 的行为是设计使然,但也许您可以使用自定义 nuget.config 作为解决方法(也在该答案中进行了解释)。

关于nuget - 有没有办法配置 NuGet 以忽略不可用的包源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46151156/

相关文章:

visual-studio - nuget .props 和 .targets 文件应该是源代码存储库的一部分吗?

.net - 如何使 VS2013 中的包管理器控制台可用(未禁用)?

visual-studio - 缺少 NuGet 包,但 "Packages Already Installed"

proxy - 在没有代理设置的情况下在 VSTS 中运行 nuget 任务

azure-devops - 将 *.snupkg 符号包发布到 VSTS 中的私有(private)订阅源

visual-studio - NuGet 无法加载源身份验证失败的服务索引

c# - 如何将共享的 C# NuGet 依赖项添加到 C++/Cli 项目?

nuget - 如何让 Visual Studio 2015 RC 从我的 nuget.config 中获取 repositoryPath 设置?

nuget - 将nuget包的文件和文件夹放在根文件夹中

c# - 强制重新下载 nuget 包