Visual Studio 2015 NuGet Update-Package 失败/报错:Update-Package : Unable to load the service index for source https://api.nuget.org/v3/index.json.

时间:2023-03-09 03:31:27
Visual Studio 2015 NuGet Update-Package 失败/报错:Update-Package : Unable to load the service index for source https://api.nuget.org/v3/index.json.

起因

为了用VS2015 community中的NuGet获取Quartz,在【工具】-【NuGet包管理器】-【程序包管理器控制台】中执行 Install-Package Quartz。

Visual Studio 2015 NuGet Update-Package 失败/报错:Update-Package : Unable to load the service index for source https://api.nuget.org/v3/index.json.

却报如下错误:

Update-Package : Unable to load the service index for source https://api.nuget.org/v3/index.json.

复制该网址到浏览器中,确实无法打开。

解决方法

经网上搜集资料,得知替换source即可。将原NuGet source 替换为 http://packages.nuget.org/v1/FeedService.svc/ 。

具体步骤如下。

1.打开程序包管理器设置。

Visual Studio 2015 NuGet Update-Package 失败/报错:Update-Package : Unable to load the service index for source https://api.nuget.org/v3/index.json.

2.在打开的【选项】窗口中单击左侧【NuGet包管理器】下的【程序包源】

单击右上角的“+”按钮,添加源,将其路径改为 http://packages.nuget.org/v1/FeedService.svc/,并可自定义源的名称,并单击【更新】,将该源标记为勾选状态,并取消默认源 nuget.org的勾选状态。完成操作后单击【选项】窗口的【确定】按钮,完成设置。

Visual Studio 2015 NuGet Update-Package 失败/报错:Update-Package : Unable to load the service index for source https://api.nuget.org/v3/index.json.

此时便可以执行命令,亦可浏览在线NuGet程序包。

Visual Studio 2015 NuGet Update-Package 失败/报错:Update-Package : Unable to load the service index for source https://api.nuget.org/v3/index.json.

参考博文:Update-Package : Unable to load the service index for source https://api.nuget.org/v3/index.json.