dotnet-update-packages
Use when user mentions updating NuGet packages, checking for outdated dependencies, upgrading .NET package versions, or asks about package updates in a .NET project.
When & Why to Use This Skill
This Claude skill automates the management and synchronization of NuGet dependencies within .NET environments. It streamlines the process of identifying outdated packages, analyzing complex dependency trees (including transitive references), and executing safe updates via the .NET CLI. By enforcing a structured workflow—updating leaf projects before dependents and verifying builds—it minimizes the risk of breaking changes and ensures project stability.
Use Cases
- Routine Dependency Audits: Automatically scan .NET solutions to identify outdated NuGet packages and generate a comprehensive report of current vs. latest versions.
- Security & Vulnerability Patching: Quickly locate and upgrade specific packages to address security vulnerabilities or deprecated versions across multiple projects.
- Transitive Dependency Resolution: Analyze and manage indirect dependencies that are not explicitly listed in the project file but are causing version conflicts or build issues.
- Large-scale Project Migration: Facilitate the upgrading of package versions during .NET framework migrations, ensuring that updates are applied in the correct architectural order.
- Automated Build Verification: Execute package updates followed by immediate build tests to catch and report breaking changes before they are committed to the codebase.
| name | dotnet-update-packages |
|---|---|
| description | Use when user mentions updating NuGet packages, checking for outdated dependencies, upgrading .NET package versions, or asks about package updates in a .NET project. |
.NET Package Updates
When to Use
This skill applies when the user:
- Asks about outdated NuGet packages
- Wants to update dependencies in a .NET project
- Mentions package version upgrades
- Discusses dependency management in .NET
Workflow
List outdated packages (including transitive) using:
dotnet package list --outdated --include-transitive --format jsonParse output to identify:
- Projects with outdated packages
- Whether each package is direct or transitive
Analyze project dependencies by reading
<ProjectReference>elements in each csprojPresent findings in a readable format showing project, package name, current → latest version
Confirm with user before making changes
Update packages per project with
--projectparameter:- Update leaf projects first (no dependencies)
- Then update dependent projects
- Independent branches can run in parallel
dotnet package update <package> --project <path-to-csproj>Verify with
dotnet buildIf build fails, ask user:
- Fix automatically (review errors, apply fixes)
- Fix manually (show errors, let user handle)
Key Commands
| Command | Purpose |
|---|---|
dotnet package list --outdated --include-transitive --format json |
List outdated packages (incl. transitive) |
dotnet package update <name> --project <path> |
Update specific package in project |
dotnet package update --project <path> |
Update all packages in project |
Transitive vs Direct Packages
- Direct: Explicitly in csproj. Update directly.
- Transitive: Pulled in by dependencies. Marked
[T]in output.- To update: update the parent package, or add direct reference to pin version
Notes
- Requires .NET 8+ SDK for
dotnet package update - Always use
--projectparameter to update per-project - Update in dependency order: leaves first, then dependents
- Always confirm with user before updating
- Run build after updates to catch breaking changes