dotnet-centralized-packages

Centralize NuGet package versions in a Directory.Packages.props file for .NET projects.

14|Updated Oct 31, 2025
One-click install
npx skills add https://github.com/NotMyself/claude-stack-dotnet --skill dotnet-centralized-packages
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-centralized-packages
Source: https://github.com/NotMyself/claude-stack-dotnet/tree/main/.claude/skills/dotnet-centralized-packages
Command: npx skills add https://github.com/NotMyself/claude-stack-dotnet --skill dotnet-centralized-packages

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines NuGet package version management across multi-project .NET solutions, eliminating version conflicts and simplifying updates by centralizing all package versions in a single Directory.Packages.props file.

Core Features & Use Cases

  • Single Source of Truth: Define all package versions in one central location, ensuring consistency across projects.
  • Simplified Updates: Update a package version once, and all dependent projects automatically inherit the change.
  • Conflict Prevention: Avoid common NU1008 errors and transitive dependency conflicts.
  • Use Case: In a large solution with many projects, use this skill to standardize package versions, making maintenance and upgrades significantly easier and more reliable.

Quick Start

Explain how to add a new NuGet package using Centralized Package Management in my .NET project.

Frequently Asked Questions about dotnet-centralized-packages

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I centralize NuGet package versions across multiple .NET projects?

Centralize NuGet package versions by creating a Directory.Packages.props file at your solution root. Define all package versions there, enable Central Package Management in your projects, and remove version numbers from individual package references. This ensures consistency across your solution and prevents version conflicts.

What is Central Package Management and when should I use it?

Central Package Management (CPM) is a .NET feature that consolidates package version definitions in one file instead of scattering them across projects. Use it in multi-project solutions to maintain a single source of truth, simplify updates, and avoid transitive dependency conflicts like NU1008 errors.

How do I add a new NuGet package using centralized package management?

Add the package version to your Directory.Packages.props file, then reference it in project files without specifying a version. The project automatically inherits the version from the central file, ensuring all projects use the same release.

Can I use Directory.Packages.props with Directory.Build.props?

Yes, Directory.Packages.props and Directory.Build.props work together. Directory.Packages.props manages NuGet versions centrally while Directory.Build.props handles build properties and settings, providing complementary organization at the solution level.

What properties do I need to enable Central Package Management in .NET?

Enable ManagePackageVersionsCentrally and set CentralPackageTransitivePinningEnabled properties in your project files or Directory.Build.props. These enforce centralized version control and pin transitive dependencies, preventing version drift.

How do I troubleshoot package version conflicts when using centralized management?

Verify all packages are declared in Directory.Packages.props at the solution root, check that ManagePackageVersionsCentrally is enabled in project files, and ensure no project files override central versions. Review transitive dependencies and use CentralPackageTransitivePinningEnabled to lock them.