是否可以从脚本中的私人订阅源获取NuGet包(即需要登录/密码)?从私人订阅源通过命令行安装NuGet包
我有一个NuGet包与单个JSON文件。它托管在私人的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
创建与进料&凭据声明也导致在同一Unable to find
错误NuGet.config
。
当我从VS安装/恢复软件包时,它工作正常。
这两个问题似乎与:
- NuGet Package Restore Unable to prompt for credentials with custom feed
- https://stackoverflow.com/questions/24682237/nuget-command-line-authentication-not-working
你使用的是哪个版本的NuGet.exe?在使用最新的NuGet.exe 2.8.2(2.8.50506.491)时,使用Team City进行还原时出现了类似的问题,但使用2.8.1(2.8.50320.36)似乎可行。 – 2014-09-03 16:40:26