Today a colleague contacted me because she got an error when trying to build a specific solution inside Visual Studio. The compilation process failed on contacting the internal Azure DevOps Artifacts nuget feed.
Instead she got the following error message:
NU1301 Unable to load the service index for source
I tried to load and build the same project but I couldn’t reproduce the issue.
There are multiple reasons why this error message appears. I suggested here to try any of the following:
- Restart Visual Studio: always a good one to try first
- Run dotnet restore in Interactive Mode: Run the
dotnet restore
command in interactive mode can help resolve the issue. - Clear NuGet Cache: Sometimes, clearing the NuGet cache can help. You can do this by running the following command in the terminal:
nuget locals all -clear
Neither of my suggestions seemed to help. In the end she was able to solve the issue by removing the local nuget.config file. As she had the package feeds also configured at the global nuget.config file, Visual Studio was able to fall back and use these feeds.
Could it be that there was an error in the local nuget.config file?
That would sound like an obvious explanation. However when comparing both the local and global configuration, we couldn’t find any difference. Strange…
All input is welcome!