dotnet-project-setup

Configures .NET solution layout, .slnx files, Directory.Build.props, and global.json SDK pinning.

1|Updated Jun 2, 2026
One-click install
npx skills add https://github.com/envoydev/claude-stack --skill dotnet-project-setup-envoydev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dotnet-project-setup
Source: https://github.com/envoydev/claude-stack/tree/main/stack/skills/dotnet-project-setup
Command: npx skills add https://github.com/envoydev/claude-stack --skill dotnet-project-setup-envoydev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up a .NET solution involves many shared configuration files - .slnx, Directory.Build.props, Directory.Packages.props, global.json, and dotnet-tools.json - and getting them wrong leads to version drift, inconsistent builds across machines, and duplicated per-project settings. ## Core Features & Use Cases - Canonical solution layout: Organizes production code under src/ and tests under tests/, with a single .slnx solution file that diffs and merges cleanly. - Shared build configuration: Centralizes language baseline, target frameworks, and global usings in Directory.Build.props, and pins the SDK via global.json with rollForward policies. - Central package and tool management: Covers Directory.Packages.props for NuGet versions and .config/dotnet-tools.json for pinned CLI tools like dotnet-ef and csharpier, plus .NET Framework 4.8 specifics. - Use Case: You are starting a new ASP.NET API with a core library and test project. Use this Skill to scaffold the solution, pin the SDK, enable central package management, and add projects without hand-editing XML. ## Quick Start Set up a new .NET solution named MyApp with an src and tests layout, a .slnx solution file, central package management, and a pinned SDK in global.json.

Frequently Asked Questions about dotnet-project-setup

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

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

Add a Directory.Packages.props file at the solution root with ManagePackageVersionsCentrally set to true and PackageVersion entries for each package. Projects then use versionless PackageReference items, and dotnet add package keeps both files in sync.

How to pin the .NET SDK version with global.json?▼

Create a global.json at the solution root with an sdk version and a rollForward policy such as latestFeature. This ensures every machine and CI runner builds with the same toolchain while tolerating slightly newer patches.

What is the difference between .sln and .slnx solution files?▼

.slnx is the XML solution format, default from dotnet new sln on .NET 10 and opt-in on SDK 9.0.200+. It diffs and merges without GUID churn. dotnet sln migrate converts an existing .sln but leaves the old file for manual removal.

Does central package management work with .NET Framework 4.8 projects?▼

Yes, but projects must first be converted from packages.config to PackageReference using the Visual Studio migration command. After conversion, Directory.Packages.props with PackageVersion entries works on net48, though ASP.NET System.Web projects cannot migrate.

Why should I avoid hand-editing Directory.Packages.props?▼

Hand-editing invites typos and malformed manifests. The dotnet add package CLI writes both the central PackageVersion and the versionless PackageReference while validating that the package resolves, keeping the two files synchronized.

When should I not put settings in Directory.Build.props?▼

Analyzer configuration, TreatWarningsAsErrors, and .editorconfig belong to code-quality tooling, while package metadata, packaging, and SourceLink belong to CI workflows. Directory.Build.props should hold only the language baseline, shared target frameworks, and project-wide global usings.