推动私人nuget饲料提示证书

时间:2013-11-26 21:19:11

标签: nuget nuget-server

我使用空的Web应用程序和nuget服务器包设置了一个私有nuget feed。这一切都正常,我可以从Feed中检索,我可以使用Nuget Package Explorer发布到私有Feed。 但是我无法通过命令行发布 - 它会提示输入凭据。我已经在Appsettings中将Web应用程序中的ApiKey设置为一个简单的密码,我尝试将ApiKey添加到push命令。这会提示我输入用户名和密码。 我也尝试过SetApiKey命令但是我得到了相同的行为。 在构建服务器上,我正在尝试相同的结果。

以下是构建日志中的错误消息(识别信息x出来)

nuget pack "C:\Builds\2\OE Phase II\Common\src\WebApi\Web.Http\Bxxxxxxxs.Web.Http.csproj" -IncludeReferencedProjects -Properties Configuration=Release
  nuget SetApiKey Bxxxxxxx1 -Source http://tfs12.xxxxxxxrps.com/Nuget
  nuget push *.nupkg -s http://tfs12.xxxxxxxrps.com/Nuget/
  C:\Builds\2\OE Phase II\Common\bin\xxxxxxx.Web.Http.dll
  1 File(s) copied
  Attempting to build package from 'xxxxxxx.Web.Http.csproj'.
  Packing files from 'C:\Builds\2\OE Phase II\Common\src\WebApi\Web.Http\bin\Release'.
  Using 'xxxxxxxs.Web.Http.nuspec' for metadata.
  Found packages.config. Using packages listed as dependencies
  Successfully created package 'C:\Builds\2\OE Phase II\Common\bin\xxxxxxxs.Web.Http.1.0.0.0.nupkg'.
  The API Key 'xxxxxxx' was saved for 'http://tfs12.xxxxxxxrps.com/Nuget'.
  Pushing Bxxxxxxxrs.Data 1.0.0.0 to 'http://tfs12.xxxxxxxrps.com/Nuget/'...
  Please provide credentials for: http://tfs12.xxxxxxxrps.com/Nuget/
  Object reference not set to an instance of an object.
  UserName: Password: 

6 个答案:

答案 0 :(得分:9)

找到适用于Windows Server 2012和Nuget.Server 2.8.5的解决方案

  • 打开IIS管理器
  • 找到您的“Nuget.Server”应用程序
  • 右键单击并选择“编辑权限”
  • 转到“安全”标签

为群组“Everyone”添加“写入”权限。

答案 1 :(得分:1)

API密钥用于上传/推送包。看起来您启用了http代理,您可以通过调用nuget.exe config命令来设置用户名和密码。

一些例子:

nuget config -Set HTTP_PROXY = http:// * 。*。 -Set HTTP_PROXY.USER = domain \ user

nuget.config HTTP_PROXY

http://docs.nuget.org/docs/reference/command-line-reference

答案 2 :(得分:1)

这对我有用:网站>身份验证>启用Windows身份验证(默认情况下我只有匿名),推送将在没有用户输入的情况下使用您的域帐户。

答案 3 :(得分:0)

您使用的是哪个版本的NuGet.Server软件包? NuGet已经发布了2.7.2版本。

您可以尝试查看null ref异常是否仍然重现?感谢。

答案 4 :(得分:0)

您可能会发现this SO answer有用,因为它涵盖了如何在工作站和/或构建服务器上配置凭据,这需要通过命令行推送到需要身份验证的服务器(例如私有Feed)。 )

发布不需要API密钥。

答案 5 :(得分:0)

我也遇到过这个问题而且之前我知道它有用,原来我正在使用NuGet.exe 2.8.1升级

NuGet.exe update -self 

把它带到了2.8.3,现在工作正常。