including-generated-files

Fix MSBuild targets to include generated files in .NET builds.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

MSBuild often ignores files generated during the build process, leading to missing outputs and uncompiled source files.

Core Features & Use Cases

  • File Inclusion: Ensures that generated files are included in the build output.
  • Target Timing: Adjusts target timing for file generation and compilation.
  • Clean Target: Properly cleans generated files during the build process.
  • Use Case: Use this Skill when encountering issues with generated source files not compiling or generated files missing from the output directory.

Quick Start

Use the including-generated-files skill to include generated files in your MSBuild project.

Frequently Asked Questions about including-generated-files

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

FAQPage Schema
Why does MSBuild ignore generated files during the build process?

MSBuild ignores generated files when target timing is misconfigured, causing missing outputs and uncompiled source files. Adjusting target execution order ensures file generation happens before compilation tasks run.

How do I include generated source files in my .NET build output?

To include generated files in .NET build output, manually adjust MSBuild project files and targets to register the files. This ensures they are compiled and copied to the output directory successfully.

How do I clean up generated files during an MSBuild build?

To clean generated files during an MSBuild build, configure the Clean target within project files. This removes generated source files and prevents stale outputs from persisting across builds.

What is the best way to fix target timing for file generation in MSBuild?

The best way to fix target timing is manually adjusting MSBuild project files so file generation targets execute before compilation. This synchronizes generation and build processes to prevent missing files.

Can I use this approach for any .NET project using MSBuild?

Yes, this approach applies to .NET projects using MSBuild. It requires manual adjustments to project files and targets to resolve file inclusion, target timing, and cleanup issues within the build process.