nuget-manager by github/awesome-copilot
npx skills add https://github.com/github/awesome-copilot --skill nuget-manager此技能确保在 .NET 项目中一致且安全地管理 NuGet 包。它优先使用 dotnet CLI 来维护项目完整性,并为版本更新强制执行严格的验证和恢复工作流程。
dotnet CLI 在您的 PATH 环境变量中可用。jq(JSON 处理器)或 PowerShell(用于使用 dotnet package search 进行版本验证)。.csproj、.props 或 Directory.Packages.props 文件来或包。始终使用 和 命令。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
dotnet add packagedotnet remove package.csproj)管理还是集中(Directory.Packages.props)管理。dotnet restore 以验证兼容性。使用 dotnet add [<PROJECT>] package <PACKAGE_NAME> [--version <VERSION>]。示例:dotnet add src/MyProject/MyProject.csproj package Newtonsoft.Json
使用 dotnet remove [<PROJECT>] package <PACKAGE_NAME>。示例:dotnet remove src/MyProject/MyProject.csproj package Newtonsoft.Json
更新版本时,请遵循以下步骤:
验证版本存在:使用 dotnet package search 命令配合精确匹配和 JSON 格式来检查版本是否存在。使用 jq:dotnet package search <PACKAGE_NAME> --exact-match --format json | jq -e '.searchResult[].packages[] | select(.version == "<VERSION>")' 使用 PowerShell:(dotnet package search <PACKAGE_NAME> --exact-match --format json | ConvertFrom-Json).searchResult.packages | Where-Object { $_.version -eq "<VERSION>" }
确定版本管理方式:
Directory.Packages.props。如果存在,版本应通过 <PackageVersion Include="Package.Name" Version="1.2.3" /> 在那里管理。.csproj 文件中的 <PackageReference Include="Package.Name" Version="1.2.3" />。应用更改:使用新的版本字符串修改识别出的文件。
验证稳定性:在项目或解决方案上运行 dotnet restore。如果出现错误,请撤销更改并进行调查。
操作:执行 dotnet add src/WebApi/WebApi.csproj package Serilog。
操作:
dotnet package search Newtonsoft.Json --exact-match --format json(并解析输出以确认存在 "13.0.3")。Directory.Packages.props)。dotnet restore。每周安装量
7.8K
代码库
GitHub 星标数
26.7K
首次出现
2026年1月20日
安全审计
安装于
codex7.7K
claude-code7.6K
gemini-cli7.4K
opencode7.3K
github-copilot7.3K
cursor7.3K
This skill ensures consistent and safe management of NuGet packages across .NET projects. It prioritizes using the dotnet CLI to maintain project integrity and enforces a strict verification and restoration workflow for version updates.
dotnet CLI available on your PATH.jq (JSON processor) OR PowerShell (for version verification using dotnet package search)..csproj, .props, or Directory.Packages.props files to add or remove packages. Always use dotnet add package and dotnet remove package commands..csproj) or centrally (Directory.Packages.props).dotnet restore to verify compatibility.Use dotnet add [<PROJECT>] package <PACKAGE_NAME> [--version <VERSION>]. Example: dotnet add src/MyProject/MyProject.csproj package Newtonsoft.Json
Use dotnet remove [<PROJECT>] package <PACKAGE_NAME>. Example: dotnet remove src/MyProject/MyProject.csproj package Newtonsoft.Json
When updating a version, follow these steps:
Verify Version Existence : Check if the version exists using the dotnet package search command with exact match and JSON formatting. Using jq: dotnet package search <PACKAGE_NAME> --exact-match --format json | jq -e '.searchResult[].packages[] | select(.version == "<VERSION>")' Using PowerShell: (dotnet package search <PACKAGE_NAME> --exact-match --format json | ConvertFrom-Json).searchResult.packages | Where-Object { $_.version -eq "<VERSION>" }
Determine Version Management :
Directory.Packages.props in the solution root. If present, versions should be managed there via <PackageVersion Include="Package.Name" Version="1.2.3" />..csproj files for .Action : Execute dotnet add src/WebApi/WebApi.csproj package Serilog.
Action :
dotnet package search Newtonsoft.Json --exact-match --format json (and parse output to confirm "13.0.3" is present).Directory.Packages.props).dotnet restore.Weekly Installs
7.8K
Repository
GitHub Stars
26.7K
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex7.7K
claude-code7.6K
gemini-cli7.4K
opencode7.3K
github-copilot7.3K
cursor7.3K
97,600 周安装
<PackageReference Include="Package.Name" Version="1.2.3" />Apply Changes : Modify the identified file with the new version string.
Verify Stability : Run dotnet restore on the project or solution. If errors occur, revert the change and investigate.