dotnet-msbuild-authoring

Author MSBuild custom targets with incremental build logic for .NET 8.0+ projects.

10|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/AGIBuild/Agibuild.Fulora --skill dotnet-msbuild-authoring
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-msbuild-authoring
Source: https://github.com/AGIBuild/Agibuild.Fulora/tree/main/.cursor/skills/dotnet-msbuild-authoring
Command: npx skills add https://github.com/AGIBuild/Agibuild.Fulora --skill dotnet-msbuild-authoring

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers author and optimize MSBuild project files, leading to more efficient, reliable, and maintainable build processes.

Core Features & Use Cases

  • Custom Targets & Ordering: Define custom build steps and control their execution order.
  • Incremental Build Optimization: Implement Inputs and Outputs to speed up builds by skipping unnecessary work.
  • Props vs. Targets: Understand and leverage the correct import order for .props and .targets files.
  • Item & Metadata Management: Effectively use items and their metadata for complex build logic.
  • Conditions & Property Functions: Dynamically control build behavior based on various factors.
  • Advanced Directory.Build Patterns: Structure complex monorepo or multi-repo build configurations.
  • Use Case: You need to add a custom step to your build process that runs before compilation to generate code based on a specific input file, ensuring this step only runs when the input file changes.

Quick Start

Use the dotnet-msbuild-authoring skill to add a custom target that runs before CoreCompile and depends on a file named 'MyInput.txt'.

Frequently Asked Questions about dotnet-msbuild-authoring

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

FAQPage Schema
How do I add a custom MSBuild target that runs before CoreCompile?

To add a custom MSBuild target before CoreCompile, define your target and use the BeforeTargets attribute to execute custom build steps like code generation prior to compilation. This ensures your custom logic integrates seamlessly into the standard .NET SDK build pipeline.

Why does my MSBuild custom target run every time even when inputs haven't changed?

Your MSBuild custom target runs every time because it likely lacks incremental build optimization. By specifying the Inputs and Outputs attributes on your target, MSBuild can compare timestamps and skip execution when outputs are already up to date, significantly speeding up builds.

What is the correct import order for Directory.Build.props and targets in SDK-style projects?

The correct import order places Directory.Build.props before the SDK targets to set properties, and Directory.Build.targets after to override build behavior. This sequence ensures properties are available during SDK evaluation and targets can modify the finalized build process.

How do I pass and manipulate item metadata in MSBuild for complex build logic?

To pass and manipulate item metadata in MSBuild, use item grouping and metadata expressions to attach contextual information to files. You can then batch over these items in your targets, allowing complex build logic to dynamically process distinct groups of files based on their metadata.

Can I use property functions and conditions to dynamically control MSBuild behavior?

You can use property functions and conditions to dynamically control MSBuild behavior by evaluating expressions during the build. Conditions allow skipping targets or properties based on configuration, while property functions enable runtime calculations and string manipulation directly within your project files.

What's the best way to structure MSBuild configurations for a monorepo?

The best way to structure MSBuild configurations for a monorepo is using advanced Directory.Build.props and targets patterns. These files propagate centrally across your repository folders, allowing shared property definitions and custom target overrides without duplicating code in individual project files.