NuGet "Unable to load the service index for source"
NuGet contacts each source’s index.json service index before it can restore anything. When that request fails, restore stops with "Unable to load the service index for source" naming the feed it could not reach.
What this error means
A dotnet restore (or nuget restore) aborts early, before downloading any package, complaining it could not load the service index for one of the configured sources. It often clears on its own when the feed is a public one having a transient blip.
error : Unable to load the service index for source https://api.nuget.org/v3/index.json.
An error occurred while sending the request.
The remote name could not be resolved: 'api.nuget.org'Common causes
Transient feed outage or network blip
A momentary DNS hiccup or a 5xx from the feed makes the service index unreachable. nuget.org and hosted feeds occasionally return transient errors that succeed on retry.
Wrong or unreachable feed URL
A typo in NuGet.config, an internal feed that is firewalled off the runner, or a v2 URL where a v3 index.json is expected all make the service index fail to load.
Proxy or TLS interception in the way
A corporate proxy that blocks the feed host, or TLS interception the runner does not trust, breaks the HTTPS request to the index.
How to fix it
Retry with more detail and a longer timeout
Because most service-index failures are transient, re-run restore verbosely so you can see which source and what underlying error.
dotnet restore --verbosity normal
# isolate one source to confirm reachability
dotnet nuget list source
curl -I https://api.nuget.org/v3/index.jsonVerify the source URLs in NuGet.config
Make sure each <add> source points at the correct v3 index.json endpoint and is reachable from the runner.
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>Trust the proxy or open the firewall
- If a proxy intercepts TLS, add its root CA to the runner trust store.
- Allowlist the feed host (and
*.nuget.orgplus*.blob.core.windows.netfor nuget.org) through the firewall. - Set
HTTP_PROXY/HTTPS_PROXYso NuGet uses the proxy instead of failing the direct connection.
How to prevent it
- Add a bounded retry around
dotnet restorefor transient feed failures. - Keep feed URLs in a committed
NuGet.config, not ad hoc command flags. - Mirror critical packages into an internal feed to reduce dependence on public nuget.org.
Frequently asked questions
Why does restore fail at the service index before any package downloads?
index.json to discover the package and download endpoints. If that first request fails, it has no map of the feed and cannot proceed to any package.