asp.net - 无法加载源 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 包管理器没有找到包,但它没有工作。
知道我哪里出错了吗?
解决方案
如如何应用设置文档中所述,可以读取许多 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 文件列表后,将它们一一打开,直到找到定义错误包源的文件。
推荐阅读
- python - 如何从现有列表的不同元素创建新列表?
- vmware - 在 NixOS 上安装 VMWare Player
- r - 在 R 中使用 dplyr::if_else() 根据另一个变量的值更改 POSIXct 时间戳的时区
- django - 无法使用 django rest 框架创建嵌套评论功能
- ruby - 如何从 slack ruby bot 的字符串中提取值
- react-native - 无法打开抽屉反应原生
- html - 如何为python3.7安装HTML包
- java - 如何调用所有`Mono
` 同时 - api-doc - APIDOCJS - 在描述中添加换行符
- bash - 为什么我的变量在测试语句中起作用,而不是在 case 语句中起作用,直到我使用 echo 将其读入自身?