繁体   English   中英

如何在运行 dotnet restore 时使用私有 nuget package 源进行身份验证

[英]How to authenticate with private nuget package source while running dotnet restore

我正在尝试在命令行上运行dotnet restore --configfile NuGet.config my-solution.sln以从私有 nuget 源恢复包,但我无法使用私有 Z0558440846982BFE7FF23B159 进行身份验证

Retrying 'FindPackagesByIdAsyncCore' for source 'http://my.private.nuget/source/FindPackagesById()?semVerLevel=2.0.0'.
Response status code does not indicate success: 401 (Unauthorized).

但是,当我尝试从visual studio还原 nuget package 时,我能够成功地从visual studio还原包,我收到提示要求提供凭据,并且在添加凭据后,还原正确发生。

当我通过命令行恢复时,我试图找出需要在哪里添加私有 nuget 的凭据。

I solved this by adding my nuget credentials in the Nuget.config file, refer to this link to see how to properly format your Nuget.config file as for nuget 4.6 and below there is a different format for adding credentials to the Nuget.config than新版本的情况如何。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM