dotnet-csproj-reading

Read and modify SDK-style .csproj files for project properties and dependencies.

Updated Aug 16, 2025
One-click install
npx skills add https://github.com/dodyg/blue-nile-pds --skill dotnet-csproj-reading-dodyg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-csproj-reading
Source: https://github.com/dodyg/blue-nile-pds/tree/main/.agents/skills/dotnet-csproj-reading
Command: npx skills add https://github.com/dodyg/blue-nile-pds --skill dotnet-csproj-reading-dodyg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Agents and developers need a reliable way to understand and adjust SDK‑style .csproj files, ensuring correct project configuration, dependencies, and build behavior.

Core Features & Use Cases

  • Project Structure Insight: Parses PropertyGroup, ItemGroup, and conditional expressions to reveal current settings.
  • Safe Modification: Provides patterns for updating target frameworks, package references, and build properties without breaking the project.
  • Central Management Support: Handles Directory.Build.props, Directory.Build.targets, and central package management files.
  • Use Case: A developer wants to upgrade a library version across all projects in a solution while preserving custom build conditions; this skill guides the necessary .csproj edits.

Quick Start

Ask the dotnet-csproj-reading skill to change the TargetFramework to net9.0 in the project's .csproj file.

Frequently Asked Questions about dotnet-csproj-reading

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

FAQPage Schema
How do I safely modify SDK-style .csproj files to update package references?

To safely modify SDK-style .csproj files, parse PropertyGroup and ItemGroup sections to adjust package references without breaking existing build conditions. This ensures correct project configuration and dependency management during modifications.

How does central package management work with Directory.Build.props in .NET projects?

Central package management in .NET works by consolidating package versions in a central file, while Directory.Build.props and Directory.Build.targets define shared build properties. Parsing these files reveals the effective project settings.

Do I need the .NET 8.0 SDK and MSBuild to parse and rewrite SDK-style project files?

Yes, you need the .NET 8.0+ SDK and an MSBuild environment to accurately parse and rewrite the XML structure of SDK-style .csproj files. These tools provide the necessary build context for safe project modification.

What is the best way to upgrade a target framework across multiple .NET projects?

The best way to upgrade a target framework across multiple .NET projects is to modify the TargetFramework property within each .csproj file's PropertyGroup. This preserves custom build conditions while applying the version update.

Can I adjust conditional expressions and build properties in an SDK-style .csproj without breaking the project?

You can adjust conditional expressions and build properties in an SDK-style .csproj safely by following structured modification patterns. Parsing the existing XML configuration first ensures dependencies and target frameworks update without breaking the project.

Why does modifying a .csproj file manually break my MSBuild build conditions?

Manually modifying a .csproj file can break MSBuild build conditions because incorrect XML edits may disrupt PropertyGroup structures. Parsing the SDK-style project file first reveals current settings to prevent configuration errors.