What problem does it solve? Files generated during an MSBuild build are invisible to the rest of the build because globs expand during the evaluation phase, before execution creates them. This causes generated source files to be skipped by the compiler (CS0246 errors), generated content to be missing from the output directory, and stale artifacts to survive the Clean target. ## Core Features & Use Cases - Correct Target Timing: Choose the right BeforeTargets hook (BeforeBuild, CoreCompile;BeforeCompile, or AssignTargetPaths) based on the type of file being generated. - Item Group Registration: Add generated files to Compile, None, or Content item groups inside the generating target so they are compiled or copied to output. - Clean Support: Register every generated file in the FileWrites item group so the Clean target removes it, and use $(IntermediateOutputPath) instead of hardcoded obj/ paths. - Use Case: A custom build task generates a .cs file at build time, but the compiler reports CS0246 for a type that should exist. Hook the target with BeforeTargets="CoreCompile;BeforeCompile" and add the file to Compile and FileWrites so it compiles and cleans correctly. ## Quick Start Fix my MSBuild target so the .cs file it generates during the build is actually compiled and removed by Clean.