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-2010 - 如何手动卸载 Visual Studio 2010 扩展?

visual-studio-2015 - nuget 错误 : the path for the selected source could not be resolved

asp.net-mvc-4 - 为什么有些 Asp.Net MVC4 模板需要 System.Spatial 包?

nuget - 如何向 NuGet 包中的现有文件添加几行代码?

c# - "legacy".NET 项目是否也可以使用新的 NuGet 3 功能?

NuGet 私有(private)提要未更新 DownloadCount

c# - 从命令行更新 .net 标准 PackageReference

.net - 与packages.config、项目引用和解决方案范围的包文件夹有关的NuGet 问题

c# - NuGet VS 2012 ServicePointManager 不支持使用 https 方案的代理

nuget - 有没有办法告诉 nuGet 将文件安装到项目中,仅当该文件不在项目中时?