最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

.net - dotnet restore will not ask for credentials - Stack Overflow

programmeradmin2浏览0评论

I have a project that uses an authenticated NuGet feed on Azure DevOps. I can restore NuGet packages in the solution just fine, but it seems when I try to use dotnet to restore it doesn't want to work. Here is what I type and what I get:

dotnet restore --interactive
  Determining projects to restore...
C:\Users\...\MyProject.UnitTests.csproj : error NU1301: Unable to load the service index for source /.../nuget/v3/index.json. [C:\Users\..\MyProject.sln]
  Failed to restore C:\Users\MyProject.UnitTests.csproj (in 6.85 sec).
  4 of 5 projects are up-to-date for restore.

Obviously removed some parts of the path for security, but I verified that the path is correct and I can load it through a browser (and again, I can restore just fine through VS). The --interactive option doesn't seem to make any difference. Why would this be inaccessible? I also tried installing the credentials manager but without any change.

Ultimately I'm trying to build a PowerShell script to build several configurations at once (and an installer, etc.). First though I need to have it build which does an automatic restore which is not working.

I have a project that uses an authenticated NuGet feed on Azure DevOps. I can restore NuGet packages in the solution just fine, but it seems when I try to use dotnet to restore it doesn't want to work. Here is what I type and what I get:

dotnet restore --interactive
  Determining projects to restore...
C:\Users\...\MyProject.UnitTests.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure/.../nuget/v3/index.json. [C:\Users\..\MyProject.sln]
  Failed to restore C:\Users\MyProject.UnitTests.csproj (in 6.85 sec).
  4 of 5 projects are up-to-date for restore.

Obviously removed some parts of the path for security, but I verified that the path is correct and I can load it through a browser (and again, I can restore just fine through VS). The --interactive option doesn't seem to make any difference. Why would this be inaccessible? I also tried installing the credentials manager but without any change.

Ultimately I'm trying to build a PowerShell script to build several configurations at once (and an installer, etc.). First though I need to have it build which does an automatic restore which is not working.

Share Improve this question asked Nov 20, 2024 at 21:03 sfaustsfaust 2,37332 silver badges70 bronze badges 1
  • 1 Why the close request? If this is answered elsewhere please point me to where, I couldn't find it... – sfaust Commented Nov 25, 2024 at 17:20
Add a comment  | 

1 Answer 1

Reset to default -1

You will need to get the NuGet credential provider from this repo https://github/microsoft/artifacts-credprovider and follow the instructions in the README.md file and see if that helps.

If it still doesn’t work, try building the application using visual studio and it should pop up a sign in screen.

发布评论

评论列表(0)

  1. 暂无评论