dotnet-package

Manage NuGet packages in .NET projects via dotnet CLI commands.

5|4|Updated Nov 3, 2025
One-click install
npx skills add https://github.com/microcks/microcks-aspire --skill dotnet-package
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-package
Source: https://github.com/microcks/microcks-aspire/tree/main/.github/skills/dotnet-package
Command: npx skills add https://github.com/microcks/microcks-aspire --skill dotnet-package

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers manage NuGet package references using the dotnet CLI, eliminating manual edits to project files (csproj, Directory.Packages.props) and ensuring consistent package states across solutions.

Core Features & Use Cases

  • Add, update, or remove NuGet packages using dotnet add, dotnet remove, and dotnet restore/build workflows.
  • Enforce safe practices: never edit csproj, props, or Directory.Packages.props files directly; central management is applied via CLI commands.
  • Use Case: In a multi-project solution, quickly align PackageReference versions across projects without manual edits.

Quick Start

Use the dotnet-package skill to manage NuGet packages in a project.

  • dotnet add <PROJECT> package <PACKAGE_NAME> [--version <VERSION>]
  • dotnet remove <PROJECT> package <PACKAGE_NAME>
  • dotnet restore

Frequently Asked Questions about dotnet-package

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

FAQPage Schema
How do I add a NuGet package to a .NET project without editing the csproj file manually?

To add a NuGet package without manual edits, use the dotnet CLI command `dotnet add <PROJECT> package <PACKAGE_NAME>` to automatically update the project file and restore dependencies safely.

What is the best way to manage NuGet package versions across a multi-project .NET solution?

Managing NuGet packages across a multi-project solution is best done by driving dotnet CLI commands to align PackageReference versions, ensuring consistent package states without directly editing Directory.Packages.props.

Do I need the .NET SDK installed to use dotnet CLI for package management?

Yes, you need the .NET SDK and dotnet CLI installed to execute package management commands, verify changes via dotnet restore, and build .NET projects successfully.

Why should I avoid directly editing csproj or Directory.Packages.props files for NuGet packages?

You should avoid directly editing csproj or Directory.Packages.props to prevent manual configuration errors, enforcing safe practices by using dotnet add and dotnet remove commands for central management.

Can I remove a NuGet package and verify the .NET project still builds correctly?

Yes, you can remove a NuGet package using `dotnet remove <PROJECT> package <PACKAGE_NAME>` and verify the build integrity by running `dotnet restore` to ensure all dependencies are correctly resolved.

How does dotnet CLI handle updating existing NuGet packages in .NET projects?

The dotnet CLI handles updating existing NuGet packages by leveraging add and restore workflows to modify PackageReference entries via command line, eliminating inconsistent manual project file edits.