NuGet Package Management
Manage your NuGet packages directly from the VS Code environment with comprehensive package management features.
Overview
The NuGet Management feature provides a complete package management experience:
- Browsing NuGet Packages - Search and discover packages
- Installing Packages - Add packages to your projects
- Updating Packages - Keep packages up to date
- Removing Packages - Clean up unused packages
- Credential Injection - Secure access to private feeds
- Package Restore - Restore missing packages
- NuGet Configuration - Manage package sources and settings
Accessing the NuGet Manager
There are several ways to access the NuGet Package Manager:
- Solution Explorer: Right-click on a project or solution and select "Manage NuGet Packages"
- Command Palette: Press
Ctrl+Shift+P
and type "NuGet Manager: Open Package Manager" - Dependencies Node: Right-click on the "Dependencies" or "Packages" node in the Solution Explorer
Quick Operations
Quick Package Install
From the Solution Explorer:
- Expand a project's "Dependencies" node
- Right-click on "Packages"
- Select "Add Package"
- Search and install packages quickly
Quick Package Update
- Expand a project's "Packages" node
- Right-click on a package
- Select "Update Package"
- Choose the version to update to
Quick Package Removal
- Expand a project's "Packages" node
- Right-click on a package
- Select "Remove this package"
- Confirm the removal
Package Management in Solution Explorer
The Solution Explorer provides a hierarchical view of your packages:
- Each project has a "Dependencies" node with a "Packages" sub-node
- Expand the "Packages" node to see all installed NuGet packages
- Package versions are displayed next to each package name
- Right-click on any package to view, update, or remove it
Key Features
Multi-Project Management
- Install packages to multiple projects simultaneously
- Update packages across all projects in a solution
- View package usage across your entire solution
Version Control
- View available package versions
- Update to specific versions
- Downgrade packages when needed
- Lock package versions
Private Feed Support
- Configure private NuGet feeds
- Use credential injection for authenticated feeds
- Support for Azure Artifacts and other private repositories
Troubleshooting
If you encounter issues with NuGet packages:
- Try restoring packages manually
- Check the Output panel (
Ctrl+Shift+U
) for NuGet errors - Verify your package sources are accessible
- Check for any package conflicts in the Error List
- Make sure your projects target compatible frameworks for the packages