簡體   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