dotnet-project-structure

Standardize .NET solution layouts and MSBuild configurations with Directory.Build.props.

1|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-project-structure-rudironsoni
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-project-structure
Source: https://github.com/rudironsoni/dotnet-agent-harness/tree/main/.rulesync/skills/dotnet-project-structure
Command: npx skills add https://github.com/rudironsoni/dotnet-agent-harness --skill dotnet-project-structure-rudironsoni

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to establishing and maintaining a clean, consistent, and modern project structure for .NET solutions, improving maintainability and developer experience.

Core Features & Use Cases

  • Solution Layout: Recommends standard directory structures (src/, tests/) and solution file formats (.slnx, .sln).
  • Build Configuration: Details the use of Directory.Build.props, Directory.Build.targets, and Central Package Management (Directory.Packages.props) for shared MSBuild settings and dependency versioning.
  • Code Quality: Covers .editorconfig for consistent code style and analyzer integration.
  • Reproducible Builds: Explains global.json for SDK version pinning, nuget.config for package source management, and lock files for deterministic restores.
  • Publishing: Guides on configuring SourceLink and deterministic builds for library publishing.
  • Use Case: When starting a new .NET project, use this Skill to set up the recommended directory structure, configure Directory.Build.props for common settings like Nullable and LangVersion, and establish Central Package Management.

Quick Start

Use the dotnet-project-structure skill to generate a recommended .NET solution layout including src and tests directories.

Frequently Asked Questions about dotnet-project-structure

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

FAQPage Schema
How do I standardize .NET project structure across a solution?

Standardizing .NET project structure involves organizing solutions into `src/` and `tests/` directories and using `Directory.Build.props` to apply shared MSBuild settings like LangVersion and Nullable across all projects.

What is Central Package Management in .NET and how does it work?

Central Package Management (CPM) in .NET works by using a `Directory.Packages.props` file to define dependency versions centrally, ensuring consistent package versions across your entire solution and preventing version conflicts.

How do I enforce code style rules in a .NET solution?

You can enforce code style in a .NET solution by adding an `.editorconfig` file to your repository, which standardizes formatting rules and integrates with code analyzers to maintain consistent style across the team.

What's the best way to ensure reproducible .NET builds?

The best way to ensure reproducible .NET builds is by pinning the SDK version in `global.json`, using `nuget.config` for secure package sourcing, and enabling lock files for deterministic dependency restores.

Can I use Directory.Build.props to share MSBuild configuration across multiple projects?

Yes, you can use `Directory.Build.props` to share MSBuild configuration across multiple projects by placing the file in your repository root, allowing all projects underneath to inherit common build properties automatically.

Do I need SourceLink configured for publishing a .NET library?

Configuring SourceLink for publishing a .NET library is highly recommended because it embeds source control metadata into your assemblies, enabling deterministic builds and source debugging for package consumers.