Skip to content
wshaddix avatar

Package Management

NuGet package management guide covering Central Package Management, dependency resolution, and CLI-driven version updates for .NET solutions.

CCM score
51 of 100
skills.sh installs
521
GitHub stars
94
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers adding, removing, listing, and updating packages with dotnet CLI commands, plus restore and cache troubleshooting
  • Includes a Directory.Packages.props setup for CPM with shared version variables grouped by Akka.NET, Aspire, OpenTelemetry, and testing packages
  • Enforces CLI-only edits, since hand-editing .csproj or Directory.Packages.props risks typos and malformed XML
  • Designed for .NET solutions with several projects that need consistent package versions, with noted limits for version ranges and older SDKs

Install

$ npx -y skills add wshaddix/dotnet-skills --skill package-management -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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:

Details

Repository
github.com/wshaddix/dotnet-skills
Category
.NET & C#
First seen
Jun 3, 2026

More from wshaddix/dotnet-skills

All 13

Similar to Package Management

More .NET & C#