dotnet-msbuild-packaging

Configures .NET project files, central package versions, restore, packing, and solution files.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/bsamiee/Rasm --skill dotnet-msbuild-packaging-bsamiee
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dotnet-msbuild-packaging
Source: https://github.com/bsamiee/Rasm/tree/main/.claude/skills/dotnet-msbuild-packaging
Command: npx skills add https://github.com/bsamiee/Rasm --skill dotnet-msbuild-packaging-bsamiee

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing .csproj files, Directory.Packages.props, NuGet.config, and .slnx files involves many interacting MSBuild properties and NuGet rules, and mistakes surface as cryptic NU1xxx restore or NU5xxx pack errors. ## Core Features & Use Cases - Central Package Management: Structures Directory.Packages.props with PackageVersion items, transitive pinning, VersionOverride rules, and catalog projects. - Restore and Source Configuration: Sets up NuGet.config with packageSourceMapping, global packages folders, and pruning behavior for reproducible restores. - Package Authoring and CI Builds: Guides dotnet pack layouts (runtimes/, buildTransitive/, lib/<tfm>/.), deterministic timestamps, .slnx solution files, and CI property groups. - Use Case: When a build fails with NU1507 after adding a second feed, use this Skill to add the correct packageSourceMapping and fix the restore. ## Quick Start Review my Directory.Packages.props and NuGet.config and fix the NU1109 restore error in my solution.

Frequently Asked Questions about dotnet-msbuild-packaging

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

FAQPage Schema
How do I set up central package management in .NET?▼

Central package management uses a Directory.Packages.props file with ManagePackageVersionsCentrally set to true and PackageVersion items holding every version. Projects then declare PackageReference items without a Version attribute, and nested files can import the outer one.

How to fix NU1507 with multiple NuGet sources?▼

NU1507 occurs when central package management runs with more than one HTTP source and no source mapping. Add a packageSourceMapping section to NuGet.config that routes package id patterns to specific sources, with a wildcard pattern on the default source.

Why does NU1008 fail my PackageReference under CPM?▼

NU1008 means a PackageReference carries a Version attribute while central package management is enabled. Move the version into a PackageVersion item in Directory.Packages.props, or use VersionOverride metadata on the reference if overrides are allowed.

Does dotnet pack support native libraries per runtime?▼

Yes, native libraries go under runtimes/<rid>/native/ in the package layout, and the SDK copies the matching RID directory and flattens it on publish. Managed per-RID assemblies belong under runtimes/<rid>/lib/<tfm>/ with an AnyCPU compile assembly under ref/<tfm>/.

When should I use .slnx instead of .sln solution files?▼

The .slnx XML format is the default of dotnet new sln and supports folders, project entries, and configuration mappings with cleaner diffs. Existing .sln files can be converted with dotnet sln migrate, which writes the .slnx beside the original.