首页 > 解决方案 > 无法加载源 https://tc.xxx.yyy.intra/httpAuth/app/nuget/v1/FeedService.svc/ 的服务索引

问题描述

在构建从工作存储库克隆的解决方案时,我收到以下错误。事实上,网址https://tc.xxx.yyy.intra/httpAuth/app/nuget/v1/FeedService.svc/ 已正确添加为 NuGet 中的包源(根据 Visual Studio)。

https://tc.xxx.yyy.intra/httpAuth/app/nuget/v1/FeedService.svc/: Unable to load the service index for source https://tc.xxx.yyy.intra/httpAuth/app/nuget/v1/FeedService.svc/.
  An error occurred while sending the request.
  The remote name could not be resolved: 'tc.xxx.yyy.intra'
  https://api.nuget.org/v3/index.json: Package 'ServiceLocatorAnalyzer.1.0.6533.24990' is not found on source 'https://api.nuget.org/v3/index.json'.
  https://www.nuget.org/api/v2/: Package 'ServiceLocatorAnalyzer.1.0.6533.24990' is not found on source 'https://www.nuget.org/api/v2/'.
. Please see Error List window for detailed warnings and errors.

但是,在检查我的 AppData 文件夹中的 NuGet.config 文件(如下)后,我可以看到其中只添加了 1 个 NuGet 包源,而根据 VS 有 5 个:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
</configuration>

这是预期的行为吗?

我还删除了 NuGet.config 文件;重新启动我的 VS,因为有人提到这里VS2015 nuget 包管理器没有找到包,但它没有工作。

知道我哪里出错了吗?

标签: asp.netnuget

解决方案


如何应用设置文档中所述,可以读取许多 nuget.config 文件。其中之一是指定额外的来源。

如果您从 nuget.org/downloads 下载 nuget.exe 并使用nuget restore,它应该列出所有适用的 nuget.config 文件,尽管只有在没有发生致命错误的情况下才会发生这种情况(而且我不确定无法访问的源是否是致命的)。如果dotnet new nugetconfig安装了 .NET Core SDK 则使用,因为nugetconfig模板会清除所有其他配置源并仅添加 nuget.org。那么当你恢复时(dotnet restore -v n如果你有一个 .net 核心项目,因为默认的详细程度是最小的),所有的 nuget.config 文件都将被列出,即使它们的源不是。

获得用于还原的 nuget.config 文件列表后,将它们一一打开,直到找到定义错误包源的文件。


推荐阅读