NuGet Package Restore Failed — Visual Studio Dependency Resolution Errors
Warningapplication
Overview
Fix NuGet package restore failures in Visual Studio caused by missing package sources, version conflicts, authentication issues, and proxy configurations.
Key Details
- NuGet package restore downloads project dependencies before building in Visual Studio
- Restore failure causes cascading build errors — 'type or namespace not found' for every dependency
- Package sources can be nuget.org, private feeds, or local directories
- Package version conflicts between projects in the same solution cause restore failures
- Authentication is required for private NuGet feeds (Azure DevOps, GitHub Packages, JFrog)
Common Causes
- nuget.org unreachable due to network issues, proxy, or firewall blocking
- Private NuGet feed credentials expired or not configured
- Package version conflict: two projects requiring incompatible versions of the same package
- packages.config or .csproj referencing a package version that does not exist on any configured source
Steps
- 1Check NuGet sources: Visual Studio > Tools > NuGet Package Manager > Package Manager Settings > Package Sources — verify nuget.org is listed
- 2Clear NuGet cache: 'dotnet nuget locals all --clear' in terminal, or Tools > NuGet Package Manager > General > Clear All NuGet Cache(s)
- 3Restore from command line: 'dotnet restore' in the solution directory for detailed error output
- 4For private feeds: configure credentials in Visual Studio or nuget.config file
- 5Resolve version conflicts: use Directory.Packages.props (Central Package Management) to enforce consistent versions
Tags
nugetpackage-restorevisual-studiodependenciesdotnet
Related Items
More in Application
windows-C0000005-access-violationWindows Error 0xC0000005 — Access Violation
Errorwindows-C000007B-bad-image-formatWindows Error 0xC000007B — Bad Image Format
Errorwindows-C0000142-application-init-failedWindows Error 0xC0000142 — Application Init Failed
Errorwindows-SxS-Error-side-by-side-configuration-errorWindows Error SxS-Error — Side-by-Side Configuration Error
Warningwindows-DLL-Missing-dll-not-foundWindows Error DLL-Missing — DLL Not Found
Warningwindows-app-runtime-r6025Windows Runtime Error R6025 — Pure Virtual Function Call
WarningFrequently Asked Questions
Global packages: %USERPROFILE%\.nuget\packages. HTTP cache: %LOCALAPPDATA%\NuGet\v3-cache. Temp: %LOCALAPPDATA%\NuGet\Temp. Clear all with 'dotnet nuget locals all --clear'.