如果至少一个Source不可用,则无法安装任何NuGet软件包 [英] Can't install any NuGet Package if at least one Source is not available

查看:264
本文介绍了如果至少一个Source不可用,则无法安装任何NuGet软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VS2013(高级版)中不存在以下问题,我只能在VS2015(企业版)中重现.

The following problem does not exist in VS2013 (Premium),I can only reproduce it in VS2015 (Enterprise)

我添加了一个自定义的NuGet包源. 如果该源不可用,则无法安装任何软件包(例如EntityFramework)

I've added a custom NuGet package source. If that source if not available I cannot install any package (for example EntityFramework)

我收到一条消息

尝试收集程序包的依赖项信息 关于项目"ConsoleApplication9"的"EntityFramework.6.1.3", 定位'.NETFramework,Version = v4.5.2'

Attempting to gather dependency information for package 'EntityFramework.6.1.3' with respect to project 'ConsoleApplication9', targeting '.NETFramework,Version=v4.5.2'

Exception'System.AggregateException' " http://XXX/FeedService.svc/".

Exception'System.AggregateException' thrown when trying to add source 'http://XXX/FeedService.svc/'.

请确认您的所有在线包裹来源均可用.

Please verify all your online package sources are available.

从消息的最后一行开始,我认为这不是错误,但是正如我所说的,它可以在VS2013上运行

From the last line of the message I assume that this is not a bug but as I said it works on VS2013

您知道为什么会有所改变吗?
我可以对此做任何事情吗?

Any idea why this has changed?
Can I do anything about this?

推荐答案

这是设计使然.由于我们支持在多个源中搜索所需的软件包,因此我们需要能够在还原这些软件包之前到达所有源并获取软件包结果,以便确定并一致地进行还原.

This is by design. Since we support searching across multiple sources for the packages that you need, we need to be able to reach all sources and get the package results before restoring these packages, to be deterministic and consistent in the way we do restore.

但是,我们了解到有些用户会进入离线/在线模式,并且我们正在投资构建功能集,该功能集使您可以在离线工作时临时禁用某些来源.同时,您可以考虑创建一个不包含以下内容的自定义nuget.config 处于问题状态的源,并在离线模式下使用该源进行还原.

However, we understand that some users go into offline/online modes and we are investing in building a feature set that will enable you to temporarily disable some sources while you are working offline. In the meantime you can look into creating a custom nuget.config that does not contain the offending source and using that to restore when you are in the offline mode.

这篇关于如果至少一个Source不可用,则无法安装任何NuGet软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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