
Package Management
This is a comprehensive guide to NuGet package management with a strong emphasis on using the dotnet CLI instead of editing XML by hand. The big win here is the Central Package Management section, which shows you how to set up Directory.Packages.props to manage versions across multiple projects in one place. The shared version variables pattern is genuinely useful for keeping framework families like Akka.NET or OpenTelemetry in sync. I appreciate that it includes a "When NOT to Use CPM" section covering legacy projects and older tooling, which saves you from learning the hard way. The CLI reference is thorough and includes the dotnet-outdated tool, which you'll want if you're maintaining anything beyond a toy project.
- skills.sh installs
- 518
- GitHub stars
- 90
- last updated
- Aug 21, 2026
Install
$ npx -y skills add wshaddix/dotnet-skills --skill package-management --agent claude-codeInstalls into .claude/skills of the current project.
Files
NuGet Package Management
When to Use This Skill
Use this skill when:
- Adding, removing, or updating NuGet packages
- Setting up Central Package Management (CPM) for a solution
- Managing package versions across multiple projects
- Troubleshooting package conflicts or restore issues
Golden Rule: Never Edit XML Directly
Always use dotnet CLI commands to manage packages. Never manually edit .csproj or Directory.Packages.props files.
# DO: Use CLI commands
dotnet add package Newtonsoft.Json
dotnet remove package Newtonsoft.Json
dotnet list package --outdated
# DON'T: Edit XML directly
# <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
Why:
- CLI validates package exists and resolves correct version
- Handles transitive dependencies correctly
- Updates lock files if present
- Avoids typos and malformed XML
- Works correctly with CPM
Central Package Management (CPM)
CPM centralizes all package versions in one file, eliminating version conflicts across projects.
Enable CPM
Create Directory.Packages.props in solution root:
Sponsors
Details
- Repository
- github.com/wshaddix/dotnet-skills
- Category
- .NET & C#
- First seen
- Jun 3, 2026
More from wshaddix/dotnet-skills
All 13- Dotnet Testing Strategy619
- Dotnet Xunit619
- Modern Csharp Coding Standards589
- Csharp Wolverinefx572
- Testcontainers569
- Microsoft Extensions Dependency Injection552
- Logging Observability545
- Validation Patterns542
- Project Structure539
- Dotnet Domain Modeling538
- Serialization530
- Microsoft Extensions Configuration528