Problem
When attempting to load a project in Rider, it's stuck on nuget restore operation
Resolution
-
Clear NuGet Cache: Run the following command in your terminal to clear the NuGet caches:
dotnet nuget locals all --clear -
Verify Authentication and Configuration:
- If your project utilizes private NuGet sources, clear the stored credentials through the Rider Settings interface (
Settings | Appearance & Behavior | System Settings | Passwords | Clear). - Ensure the
PackageReference Restore Engineis configured as eitherAutomaticorEmbeddedviaSettings | Build, Execution, Deployment | NuGet. - Restart Rider to initialize fresh authentication prompts.
- If your project utilizes private NuGet sources, clear the stored credentials through the Rider Settings interface (
-
Verify access to nuget.org
Opening
https://www.nuget.orgin a browser is not sufficient. NuGet restores use the API endpointhttps://api.nuget.org/v3/index.json. From PowerShell, check that the source is configured and enabled:dotnet nuget list sourceThe output should contain:
nuget.org [Enabled] https://api.nuget.org/v3/index.jsonThen test DNS, TCP, and HTTPS access:
Widows (Powershell): Resolve-DnsName api.nuget.org Test-NetConnection api.nuget.org -Port 443 (Invoke-WebRequest -Uri 'https://api.nuget.org/v3/index.json' -UseBasicParsing).StatusCode Linux/Mac: dig +short api.nuget.org nc -vz -w 10 api.nuget.org 443 curl -fsSL --max-time 20 -o /dev/null -w 'HTTP %{http_code}\n' https://api.nuget.org/v3/index.json curl -v --max-time 20 https://api.nuget.org/v3/index.json env | grep -iE '^(http|https|all|no)_proxy='The expected results are a successful DNS lookup,
TcpTestSucceeded: True, and HTTP status200.Finally, test an actual package restore in a temporary directory:
dotnet new classlib --name NuGetConnectivityCheck --output .\NuGetConnectivityCheck --no-restore dotnet add .\NuGetConnectivityCheck\NuGetConnectivityCheck.csproj package Newtonsoft.Json --version 13.0.3 --no-restore dotnet restore .\NuGetConnectivityCheck\NuGetConnectivityCheck.csproj --source https://api.nuget.org/v3/index.json --force --no-http-cache --packages .\NuGetConnectivityCheck\packages --verbosity normalA DNS failure, TCP timeout, HTTP
407, TLS/certificate error,NU1301, orTaskCanceledExceptionusually indicates a firewall, proxy, VPN, DNS, or TLS-inspection issue. Contact your IT support for the issue resolution. Provide the failing hostname and error to the network administrator.
Nothing helped
If problems continue after following these steps, contact support and provide the following details for further analysis:
- Screenshot for configurations on Settings | Build, Execution, Deployment | NuGet page
- Rider logs with NuGet tracing enabled:
- Go to Help | Diagnostic Tools | Choose Trace Scenarios;
- Enable NuGetAll, NuGetSearch trace scenarios;
- Reproduce the issue;
- Share the output in the NuGet toolwindow | Log tab;
- Collect logs via Help | Collect Logs and Diagnostic Data;
- Disable the trace scenarios enabled;
- Upload the logs to the Upload Service and share the Upload ID.
Comments
0 comments
Please sign in to leave a comment.