NuGet Package Management
Package Restore Operations
Restore missing NuGet packages for your projects.
What is Package Restore?
Section titled “What is Package Restore?”Package restore downloads packages referenced in project files but not present locally.
When to Restore
Section titled “When to Restore”Restore packages when:
- Cloning a repository
- After cleaning the solution
- Package files are missing
- After changing branches
Automatic Restore
Section titled “Automatic Restore”The extension automatically restores packages:
- When opening a solution
- Before building
- When adding a project
Manual Restore
Section titled “Manual Restore”From Solution Explorer
Section titled “From Solution Explorer”- Right-click on a project or solution
- Select “Restore NuGet packages”
- Wait for the restore to complete
From Command Palette
Section titled “From Command Palette”- Press
Ctrl+Shift+P - Type “NuGet: Restore Packages”
- Select the command
Restore Process
Section titled “Restore Process”During restore:
- Project files are scanned for package references
- Missing packages are identified
- Packages are downloaded from sources
- Packages are extracted to the local cache
- Project references are resolved
Restore Output
Section titled “Restore Output”Monitor restore progress:
- Terminal panel shows download progress
- Output panel shows detailed logs
- Status bar shows current operation
Troubleshooting
Section titled “Troubleshooting”Restore Failed
Section titled “Restore Failed”If restore fails:
- Check internet connectivity
- Verify package sources are accessible
- Check for authentication issues
- Clear NuGet cache and retry:
Terminal window dotnet nuget locals all --clear
Slow Restore
Section titled “Slow Restore”If restore is slow:
- Check network speed
- Use a local package cache
- Mirror packages locally
- Configure parallel downloads