msbuild-including-generated-files

Integrate MSBuild-generated files into the build pipeline.

5|4|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/ViktorHofer/dotnet-skills --skill msbuild-including-generated-files
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: msbuild-including-generated-files
Source: https://github.com/ViktorHofer/dotnet-skills/tree/main/msbuild-skills/skills/including-generated-files
Command: npx skills add https://github.com/ViktorHofer/dotnet-skills --skill msbuild-including-generated-files

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the issue where files generated during the MSBuild build process are not correctly included or compiled, leading to missing outputs or compilation errors.

Core Features & Use Cases

  • Correctly Include Generated Files: Ensures files created during the build are recognized by MSBuild.
  • Handle Source Code Generation: Integrates newly generated .cs files into the compilation phase.
  • Manage Non-Code Assets: Includes generated configuration or data files in the output.
  • Use Case: When a custom build step generates C# source files that need to be compiled, or configuration files that must be copied to the output directory, this skill provides the MSBuild targets to ensure they are handled properly.

Quick Start

Use the msbuild-including-generated-files skill to ensure that files generated by a custom build target are included in the compilation process.

Frequently Asked Questions about msbuild-including-generated-files

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

FAQPage Schema
How do I include generated files in the MSBuild build process?

To include generated files in the MSBuild build process, you leverage MSBuild targets and item groups to ensure dynamically created files are recognized, compiled, or copied to the output directory.

Why are my dynamically generated .cs files missing during MSBuild compilation?

Dynamically generated .cs files are missing during MSBuild compilation because the build pipeline does not automatically recognize them. You must use specific MSBuild targets to integrate newly generated source files into the compilation phase.

How do I copy non-code generated assets to the output directory in MSBuild?

To copy non-code generated assets to the output directory in MSBuild, you configure item groups within your build targets to ensure generated configuration or data files are properly included in the final output.

Does MSBuild support compiling source code generated by custom build targets?

MSBuild supports compiling source code generated by custom build targets by utilizing specific target execution sequences that feed the newly created source files directly into the compilation phase.

What is the best way to handle dynamically created configuration files in an MSBuild target?

The best way to handle dynamically created configuration files in an MSBuild target is to define item groups that capture these non-code assets during the build process and copy them to the output directory.