smithery.ai

dotnet-package

Manage NuGet packages using dotnet CLI commands. Use when adding, removing, or updating packages in .NET projects. Never edit .csproj or Directory.Packages.props files directly.

First seen Mar 28, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,660 B
  • docs SUMMARY.md 199 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

dotnet-package Skill

Core Rules

  1. NEVER directly edit .csproj, .props, or Directory.Packages.props files
  2. ALWAYS use dotnet CLI commands for all package operations
  3. VERIFY changes with dotnet restore or dotnet build

Commands

Add Package

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

Latest version (no --version flag):

dotnet add src/Microcks.Aspire/Microcks.Aspire.csproj package Aspire.Hosting.Kafka

Specific version:

dotnet add src/Microcks.Aspire/Microcks.Aspire.csproj package Testcontainers --version 3.7.0

Remove Package

dotnet remove [<PROJECT>] package <PACKAGE_NAME>

Example:

dotnet remove tests/Microcks.Aspire.Tests/Microcks.Aspire.Tests.csproj package Refit

Update Package

Use dotnet add package with --version to update existing packages:

dotnet add <PROJECT> package <PACKAGE_NAME> --version <VERSION>

When version not specified, find latest:

LATEST_VERSION=$(dotnet package search <PACKAGE_NAME> --exact-match --format json | jq -r '.searchResult[].packages[0].version')
dotnet add <PROJECT> package <PACKAGE_NAME> --version $LATEST_VERSION

Verify Changes

Always verify after operations:

dotnet restore
# or
dotnet build

Examples

Add latest version:

dotnet add src/Microcks.Aspire/Microcks.Aspire.csproj package Aspire.Hosting.Redis

Add specific version:

dotnet add tests/Microcks.Aspire.Testing/Microcks.Aspire.Testing.csproj package Aspire.Hosting.Testing --version 9.1.0

Update to specific version:

dotnet add src/Microcks.Aspire/Microcks.Aspire.csproj package Testcontainers --version 3.9.0
dotnet restore

Update to latest version:

LATEST_VERSION=$(dotnet package search Aspire.Hosting.Kafka --exact-match --format json | jq -r '.searchResult[].packages[0].version')
dotnet add src/Microcks.Aspire/Microcks.Aspire.csproj package Aspire.Hosting.Kafka --version $LATEST_VERSION
dotnet restore

Remove package:

dotnet remove tests/Microcks.Aspire.Tests/Microcks.Aspire.Tests.csproj package Refit

Notes

  • Central Package Management (Directory.Packages.props) is handled automatically by the CLI
  • dotnet add package without --version uses latest stable version
  • Failures leave project files unchanged, ensuring integrity