dotnet-project-setup

Create and reorganize .NET solutions with shared build settings, project templates, and test scaffolding.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/zhenpengLai/myuseskill --skill dotnet-project-setup-zhenpenglai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dotnet-project-setup
Source: https://github.com/zhenpengLai/myuseskill/tree/main/dotnet-project-setup
Command: npx skills add https://github.com/zhenpengLai/myuseskill --skill dotnet-project-setup-zhenpenglai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Setting up a new .NET solution or restructuring an existing one involves many scattered decisions: project layout, naming conventions, shared MSBuild settings, package version management, SDK pinning, and test scaffolding. This Skill consolidates those decisions into a repeatable workflow so repositories start with clean boundaries and consistent defaults. ## Core Features & Use Cases - Solution Structure Guidance: Establishes src/tests/samples layouts, naming conventions for libraries, APIs, workers, and test projects, plus solution filters for partial loading. - Shared Build Configuration: Provides templates for Directory.Build.props, Directory.Build.targets, Central Package Management, global.json, nuget.config, .editorconfig, analyzers, multi-targeting, and Source Link. - Project Templates: Covers dotnet new commands and starter code for console apps, class libraries, ASP.NET Core APIs, Blazor, worker services, gRPC, xUnit tests, and .NET Aspire. - Use Case: When starting a new microservices repository, use this Skill to scaffold the solution, pin the SDK, centralize package versions, and wire up test projects and CI-ready build settings in one pass. ## Quick Start Ask the assistant to create a new .NET solution with an API project, a core library, centralized package management, and xUnit test projects.

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 a new .NET solution with multiple projects?▼

Create the solution with dotnet new sln, add projects under src/ and tests/ using dotnet new, then register them with dotnet sln add and wire dependencies with dotnet add reference. Follow naming conventions like ProductName.Core and ProductName.Api for clear boundaries.

How to centralize NuGet package versions in .NET?▼

Enable Central Package Management by adding a Directory.Packages.props file at the repo root with ManagePackageVersionsCentrally set to true. Declare PackageVersion entries there, and project files then reference packages without version numbers.

What is Directory.Build.props used for in .NET?▼

Directory.Build.props is automatically imported by MSBuild for all projects in its directory tree, letting you centralize settings like TargetFramework, Nullable, ImplicitUsings, analyzers, and warning policies. Child directories can extend it via an explicit Import.

Does global.json affect which .NET SDK version is used?▼

Yes, global.json pins the SDK version for reproducible builds across machines and CI. The rollForward policy controls whether newer patches, feature bands, or major versions may be substituted when the exact SDK is missing.

When should I use solution filters instead of the full .sln file?▼

Use .slnf solution filters when a large solution slows down IDE loading or CI builds and you only need a subset of projects, such as one API and its tests. They reference the main solution and list only the required project paths.