【发布时间】:2014-10-28 04:18:01
【问题描述】:
是否可以从脚本中的私人提要(即需要登录名/密码)获取 NuGet 包?
我有一个带有单个 JSON 文件的 NuGet 包。它托管在私人 TeamCity 提要上。我想在脚本中使用那个 JSON,所以这就是我想要做的:
nuget sources add -Name tc -Source https://xxxxxxxxx/ -Username username -Password password
nuget install xxxxxxxx -source tc
nuget sources remove -Name tc
这会导致Unable to find version '1.0.7' of package 'xxxxxxx'. 这很奇怪,因为它显然能够访问提要,因为它看到了包的版本,但无法下载包。
我还尝试将包安装到虚拟 .sln 中并运行 nuget restore xxxxx.sln。然后 NuGet 两次要求我提供凭据:
Please provide credentials for: https://xxxxxxxx/httpAuth/app/nuget/v1/xxxxx.svc/
Please provide credentials for: https://xxxxxxxx/httpAuth/repository/download/xxxxx/1148145:id/xxxxxxxx.1.0.7.nupkg
使用提要和凭据声明创建 NuGet.config 也会导致相同的 Unable to find 错误。
当我从 VS 安装/恢复包时,它工作正常。
这两个问题似乎相关:
【问题讨论】:
-
您使用的是哪个版本的 NuGet.exe?使用最新的 NuGet.exe 2.8.2 (2.8.50506.491) 但使用 2.8.1 (2.8.50320.36) 时,我在 Team City 上的还原遇到了类似的问题。
标签: nuget