wshaddix avatar

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-code

Installs 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

Recommended

More .NET & C#
1umbraco avatarumbraco-backofficeumbraco/umbraco-cms-backoffice-skillsUmbraco backoffice extension customisation - complete working examples showing how extension types combine447skills.sh installs
2umbraco avatarumbraco-openapi-clientumbraco/umbraco-cms-backoffice-skillsSet up OpenAPI client for authenticated API calls in Umbraco backoffice (REQUIRED for custom APIs)405skills.sh installs
3umbraco avatarumbraco-property-editor-uiumbraco/umbraco-cms-backoffice-skillsImplement property editor UIs in Umbraco backoffice using official docs405skills.sh installs
4syncfusion avatarsyncfusion-blazor-licensesyncfusion/blazor-ui-components-skillsGenerate, register, secure, validate, and troubleshoot Syncfusion Blazor license keys across all Blazor project types403skills.sh installs
5umbraco avatarumbraco-mfa-login-providerumbraco/umbraco-cms-backoffice-skillsImplement MFA login providers for Umbraco backoffice using official docs400skills.sh installs
6umbraco avatarumbraco-auth-providerumbraco/umbraco-cms-backoffice-skillsImplement authentication providers for Umbraco backoffice using official docs399skills.sh installs