dotnet-project-structure

Standardize .NET repository setup with .slnx, centralized MSBuild properties, and SDK pinning.

Updated Jan 29, 2024
One-click install
npx skills add https://github.com/riandeoliveira/aspnet-template --skill dotnet-project-structure-riandeoliveira
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-project-structure
Source: https://github.com/riandeoliveira/aspnet-template/tree/main/.claude/skills/project-structure
Command: npx skills add https://github.com/riandeoliveira/aspnet-template --skill dotnet-project-structure-riandeoliveira

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill removes the guesswork of setting up a modern .NET repository by showing a standardized layout for build configuration, centralized dependency management, solution format, SDK pinning, and automated versioning.

Core Features & Use Cases

  • Modern solution format (.slnx): Use the .NET 9+ XML-based solution format for cleaner diffs and easier collaboration.
  • Centralized build configuration (Directory.Build.props): Apply consistent compiler options, metadata, SourceLink, and packaging settings across all projects in the tree.
  • Central package version management (Directory.Packages.props): Define package versions once to prevent version drift across apps and tests.
  • Deterministic SDK selection (global.json): Pin the .NET SDK to keep builds reproducible across developer machines and CI.
  • Release notes-driven version management: Use RELEASE_NOTES.md and build orchestration to update versioning automatically, supporting repeatable release workflows.
  • NuGet configuration (NuGet.Config): Ensure predictable package sources for reliable restores and publishes.

Quick Start

Apply this repository template guidance to create a new .NET solution using .slnx with Directory.Build.props, Directory.Packages.props, global.json, and RELEASE_NOTES.md-based version automation.

Frequently Asked Questions about dotnet-project-structure

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

FAQPage Schema
How do I set up a .NET repository with central package management and consistent builds?

You can standardize a .NET repository by using Directory.Packages.props for central package versioning and Directory.Build.props for shared MSBuild properties, ensuring consistent builds and preventing version drift across projects.

What is the .slnx solution format and when should I use it for .NET projects?

The .slnx format is a .NET 9+ XML-based solution file that provides cleaner diffs and easier collaboration. You should use it when migrating or creating multi-project solutions to simplify repository structure management.

How do I pin the .NET SDK version to keep builds reproducible across machines?

You pin the .NET SDK version by using a global.json file in your repository, which specifies the required SDK version to maintain deterministic builds across developer machines and CI pipelines.

How do I automate version updates using release notes in a .NET build pipeline?

You can automate version updates by maintaining a RELEASE_NOTES.md file and using build orchestration to read it, supporting repeatable release workflows and automated versioning for your .NET projects.

Does SourceLink integration work with centralized MSBuild properties in .NET?

SourceLink integration works with centralized MSBuild properties by configuring it inside Directory.Build.props, which applies the source debugging metadata and packaging settings across all projects in the directory tree.

What is the best way to prevent NuGet package version drift in a multi-project .NET solution?

The best way to prevent package version drift is central package management using Directory.Packages.props, which defines package versions once for the entire solution to ensure predictable restores and consistent dependencies.