Search code examples
c#.net.net-corenuget

NuGet Restore keeps coming up with removed package source


I'm currently encountering some problems with nuget / dotnet restore.

Couple of days ago I created myself a NuGet Package on Azure Dev Ops for testing purposes. This Package has been installed at one Project, lets call it ProjectA.

Now the Problem is, when trying to dotnet restore on ProjectB it wanted the Credentials for the Package source, since the credentials window didn't show up (neither hidden or outside VS) I decided to remove the package source completly. I cleared the nuget cache, deleted the obj and bin folder, deleted the nuget config, removed unused reference, cleaned & rebuild the project - the issue still persists.

Now comes the "funny" part, I then decided to load up the test project (ProjectA) and remove the test nuget package there, after this, I can restore ProjectA. But the Error still occurs at ProjectB, ProjectC... which never had the nuget package installed in the first place.

I can't compile/build anything with dotnet since the restore always fails. This is the error msg:

C:\Program Files\dotnet\sdk\8.0.108\NuGet.targets(156,5): error : Unable to load the service index for source https://p
kgs.dev.azure.com/xxxxx/_packaging/xxxxx/nuget/v3/index.json. [E:\Users\Haku\source\repos\ProjectB\ProjectB\ProjectB.csproj]
C:\Program Files\dotnet\sdk\8.0.108\NuGet.targets(156,5): error :   Response status code does not indicate success: 401
 (Unauthorized).```


Solution

  • Solution to the issue was reinstalling the .NET 8 SDK. Apparently it was some weird caching issue since ALL configs etc where cleared.