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

I have a project that uses an authenticated NuGet feed on Azure DevOps.I can restore NuGet packages i

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742328332a4423201.html

相关推荐

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

    I have a project that uses an authenticated NuGet feed on Azure DevOps.I can restore NuGet packages i

    9小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信