nugetnuget-package-restore

Nuget Restore Error NU1301 Load Service Failure


When I run dotnet restore --interactive it keeps sending this error:

error NU1301: Unable to load the service index for source https://www.nuget.org/api/v3/index.json

But when I checked out my source configration in Nuget management, it is https://api.nuget.org/api/v3/index.json and it can be opened through browser.

How can I change that url to the correct one?

I can see in .nuget/nuget/nuget.Config the packageSource settings has the line with:

key="nuget.org" value="https://api.nuget.org/v3/index.json" protocalVersion="3"

But when I go restore nuget packages, it is still hitting https://www.nuget.org/api/v3/index.json. Why? Are there any other files I missed to change?


Solution

  • I have found the answer from here:

    There is individual nuget.config existed in one of the project folder. Reference to https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior