aaronontheweb avatar

Package Management

This is for managing NuGet packages in .NET projects using Central Package Management and the dotnet CLI. The core principle is simple: never edit XML directly, always use CLI commands. It walks you through setting up CPM with Directory.Packages.props to centralize versions across projects, and shows how to use shared version variables for package families like Akka.NET or OpenTelemetry where you want everything on the same version. The guide is honest about when not to use CPM, like legacy projects where version conflicts will surface all at once, or when you're stuck on older tooling. Includes the full command reference for adding, removing, listing, and updating packages.

skills.sh installs
613
GitHub stars
1.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add aaronontheweb/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/aaronontheweb/dotnet-skills
Categories
Release Management, CLI & Terminal, .NET & C#
First seen
Jun 3, 2026

More from aaronontheweb/dotnet-skills

All 34
1voltagent avatarvoltagent-docs-bundlevoltagent/skillsLook up VoltAgent documentation embedded in node_modules/@voltagent/core/docs for version-matched docs. Use for API signatures, guides, and examples.613skills.sh installs
2tencentcloudbase avatarcloudbasetencentcloudbase/skillsUse this skill when you develop, design, build, deploy, debug, migrate, or troubleshoot CloudBase (腾讯云开发, 云开发, TCB, 微信云开发) projects. Covers Web, 微信小程序, 小程序, uni608skills.sh installs
3alirezarezvani avatarroadmap-communicatoralirezarezvani/claude-skillsUse when preparing roadmap narratives, release notes, changelogs, or stakeholder updates tailored for executives, engineering teams, and customers.604skills.sh installs
4astronomer avatarmanaging-astro-deploymentsastronomer/agentsManage Astronomer production deployments with Astro CLI. Use when the user wants to authenticate, switch workspaces, create/update/delete deployments, or deploy595skills.sh installs
5mohitmishra786 avatardebug-optimized-buildsmohitmishra786/low-level-dev-skillsDebugging optimized builds skill for diagnosing issues in release code. Use when debugging RelWithDebInfo builds, using -Og for debuggable optimization, working579skills.sh installs
6jshchnz avatarschedulerjshchnz/claude-code-schedulerSchedules Claude Code tasks to run automatically at specific times using native OS schedulers (launchd on macOS, crontab on Linux, Task Scheduler on Windows). H574skills.sh installs