property-patterns

Diagnose and correct MSBuild property definitions in .props and .csproj files.

Updated May 28, 2026
One-click install
npx skills add https://github.com/ojrojas/AgentsInstructions --skill property-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: property-patterns
Source: https://github.com/ojrojas/AgentsInstructions/tree/main/.claude/skills/dotnet-msbuild/skills/property-patterns
Command: npx skills add https://github.com/ojrojas/AgentsInstructions --skill property-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you to efficiently diagnose and correct issues related to MSBuild property definitions and resolve order, which is crucial for accurate build automation and cross-platform compatibility.

Core Features & Use Cases

  • Property Definition Patterns: Provides canonical patterns for property definition, including conditional defaults and semicolon concatenation.
  • Path Normalization and Handling: Assists with cross-platform path handling and normalization to prevent build failures.
  • Target Framework Detection: Offers utility to detect and apply properties based on the target framework.
  • Property Evaluation Order: Explains the evaluation order and 'last write wins' semantics of property assignments.
  • Common Pitfalls Avoidance: Lists and remedies common property configuration errors such as overwriting and incorrect condition usage.
  • Use Case: When you need to ensure that MSBuild properties are set correctly in your project files to prevent errors and ensure builds are as expected.

Quick Start

Run the property-patterns skill in your MSBuild project directory to ensure proper property definitions are in place.

Frequently Asked Questions about property-patterns

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

FAQPage Schema
How does MSBuild property evaluation order affect my .NET build configuration?

MSBuild property evaluation follows a 'last write wins' semantic where later assignments overwrite earlier ones. Understanding this resolution order is crucial for setting accurate conditional defaults and preventing unexpected property overwrites in .csproj and .props files.

What is the best way to handle cross-platform path normalization in MSBuild project files?

Cross-platform path normalization in MSBuild prevents build failures across different operating systems. You should apply canonical property definition patterns that properly format directory separators and resolve relative paths for consistent target framework builds.

How do I set conditional MSBuild properties for different target frameworks in C#?

You can set conditional MSBuild properties for different target frameworks by using conditional logic within your project files. This detects the target framework and applies specific property assignments using properly structured conditions to ensure correct build automation.

Why are my MSBuild properties overwriting earlier values in .props files?

MSBuild properties overwrite earlier values because the evaluation engine uses 'last write wins' semantics. If multiple .props or .csproj files assign the same property, the final evaluated assignment takes precedence based on the import order.

Can I use semicolon concatenation to combine MSBuild property values for build automation?

Yes, you can use semicolon concatenation to combine MSBuild property values for build automation. This pattern allows you to aggregate lists of items or paths into a single property definition, which is essential for managing multi-target framework configurations.

What are common pitfalls when configuring MSBuild properties for cross-platform .NET builds?

Common MSBuild property configuration pitfalls include incorrect condition usage, unexpected property overwriting due to import order, and failing to normalize paths. Avoiding these errors ensures your cross-platform .NET builds execute accurately and as expected.