Guide for organizing MSBuild infrastructure with Directory.Build.props, Directory.Build.targets, Directory.Packages.props, and Directory.Build.rsp. Only…
Organizing Build Infrastructure with Directory.Build Files
Directory.Build.props vs Directory.Build.targets
Understanding which file to use is critical. They differ in when they are imported during evaluation:
Evaluation order:
Directory.Build.props → SDK .props → YourProject.csproj → SDK .targets → Directory.Build.targets
Use .props for
Use .targets for
Setting property defaults
Custom build targets
Common item definitions
Late-bound property overrides
Properties projects can override
Post-build steps
Assembly/package metadata
Conditional logic on final values
Analyzer PackageReferences
Targets that depend on SDK-defined properties
related skills
semantically similar in the cross-vendor index
don't have the plugin yet? install it then click "run inline in claude" again.
+clearly explains evaluation order (props before csproj, targets after), which is the core decision point for tool selection
+provides concrete use-case mapping (e.g. 'use .props for property defaults, use .targets for post-build steps')
+avoids jargon without losing technical precision on msbuild mechanics
weaknesses
~no trigger phrases at all - reads as reference material, not actionable guidance for when to invoke this skill
~missing intent/inputs/output-contract and outcome-signal; no worked example showing before/after state
~no edge cases covered (e.g. circular imports, conflicting overrides across projects, sdk version incompatibilities, property shadowing)
~incomplete comparison table (columns labeled but content missing under 'use .props for' and 'use .targets for')