dotnet-package-management

Centralizes .pg-asp.net package management via CLI and DATABASEPackages.props for multi-project solutions.

3|Updated Jan 24, 2024
One-click install
npx skills add https://github.com/akoken/dotfiles --skill dotnet-package-management
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-package-management
Source: https://github.com/akoken/dotfiles/tree/main/config/.copilot/skills/dotnet-package-management
Command: npx skills add https://github.com/akoken/dotfiles --skill dotnet-package-management

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps development teams manage NuGet package versions consistently across multiple projects by leveraging Central Package Management (CPM) and the dotnet CLI, preventing drift and manual XML edits.

Core Features & Use Cases

  • Centralized version control using Directory.Packages.props to minimize conflicts and simplify upgrades.
  • CLI-guided package management: add, remove, and list commands with versions controlled centrally.
  • Use Case: When maintaining a solution with many projects, CPM ensures uniform package versions without editing XML.

Quick Start

Create a Directory.Packages.props in the solution root to define centralized versions, then reference packages in each project without version attributes and use dotnet add package, dotnet remove package, or dotnet list package to manage them.

Frequently Asked Questions about dotnet-package-management

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

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

Central Package Management (CPM) unifies NuGet package versions across multiple .NET projects using a Directory.Packages.props file. It enforces dotnet CLI commands for adding, removing, and listing packages while prohibiting manual XML edits to individual project files.

What is Central Package Management and when do I need it for my .NET solution?

Central Package Management is a .NET feature that synchronizes NuGet package versions across multi-project solutions. You need it when maintaining many projects to prevent version drift, minimize conflicts, and simplify upgrades without manually editing XML files.

How do I set up Directory.Packages.props to centralize NuGet versions?

Create a Directory.Packages.props file at your .NET solution root to define centralized package versions. Then reference packages in individual projects without version attributes and use dotnet add package or dotnet remove package commands to manage them.

Can I use dotnet CLI commands to add or remove packages with Central Package Management?

Yes, Central Package Management relies entirely on dotnet CLI commands. You use dotnet add package, dotnet remove package, and dotnet list package to manage dependencies while versions are controlled centrally in the Directory.Packages.props file.

Why should I avoid manual edits to project XML files when using CPM?

Manual edits to project XML files cause version drift and conflicts. Central Package Management enforces the use of Directory.Packages.props and dotnet CLI commands to ensure synchronized, safe package upgrades across all projects in your .NET solution.

Does Central Package Management work for large multi-project .NET solutions?

Yes, Central Package Management is designed specifically for multi-project .NET solutions. It applies to solutions requiring synchronized package versions, ensuring uniform dependencies and safe upgrades across many projects without manual XML intervention.