dotnet-msbuild-evaluation

Diagnose MSBuild evaluation order, conditions, properties, and items in .NET project files.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/bsamiee/Rasm --skill dotnet-msbuild-evaluation-bsamiee
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dotnet-msbuild-evaluation
Source: https://github.com/bsamiee/Rasm/tree/main/.claude/skills/dotnet-msbuild-evaluation
Command: npx skills add https://github.com/bsamiee/Rasm --skill dotnet-msbuild-evaluation-bsamiee

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing or debugging .props, .targets, and .csproj files often fails because MSBuild's evaluation order is opaque: properties read empty values, items resolve against the wrong directory, and Directory.Build.props settings get silently overridden. This Skill explains exactly which file assigns each value and when it becomes readable. ## Core Features & Use Cases - Evaluation Order Reference: Maps the six evaluation passes and the full import chain of a Microsoft.NET.Sdk project, showing which properties each file assigns. - Conditions, Properties, and Items Rules: Documents comparison operators, property functions like [MSBuild]::NormalizePath, item operations (Include, Update, Remove), and transforms with their exact semantics and error codes. - File Placement Guidance: Provides a decision table for where each declaration belongs (Directory.Build.props, Directory.Build.targets, project file, Directory.Packages.props) plus troubleshooting for common failures like MSB4011 and MSB1063. - Use Case: A value set in Directory.Build.props is ignored because the SDK reassigns it later; the Skill identifies the cause and directs you to move it to Directory.Build.targets, then verify with dotnet msbuild -getProperty. ## Quick Start Ask the AI to explain why a property in your Directory.Build.props is empty or ignored and where the declaration should be placed instead.

Frequently Asked Questions about dotnet-msbuild-evaluation

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

FAQPage Schema
Why is my Directory.Build.props value ignored in a .NET project?▼

Directory.Build.props is imported early, before the project body and SDK targets, so a later assignment overwrites your value since the last assignment wins. Move the declaration to Directory.Build.targets, which evaluates after the project body and SDK output paths.

How do I check an MSBuild property value without building?▼

Run dotnet msbuild <project> -getProperty:Name to print one value, or pass a comma-separated list for JSON output. Add -p:Name=Value to see the effect of a global property, and use -getItem:Type to inspect items with their metadata.

What is the MSBuild evaluation order for properties and items?▼

MSBuild evaluates in passes: environment variables, then imports and properties in order of appearance, then item definitions, then items, then UsingTask, then targets. Properties never read items, and item conditions read the final value of every property.

Why does my property contain literal @(Item) text in MSBuild?▼

Properties never expand item lists during evaluation, so @(Item) text stays literal until a target expands it. Read the list inside a target, or use a transform like @(Item->'%(Filename)') where item expressions are legal.

Where should shared .NET build settings go: Directory.Build.props or targets?▼

Put repository root paths, overridable defaults like Nullable, and classification properties in Directory.Build.props. Put values derived from TargetFramework or OutputType, shared items, and custom targets in Directory.Build.targets, which reads the project body.

Why is Directory.Build.props not imported on Linux or macOS?▼

MSBuild locates Directory.Build.props by exact path, so a case mismatch fails on case-sensitive file systems common on Linux and macOS. Match the file name casing exactly, including the .props extension.