Install any skill in seconds. Free to start, no credit card required.
Get Started Free →dotnet/including-generated-files
Fix MSBuild targets that generate files during the build but those files are missing from compilation or output. USE FOR: generated source files not compiling (CS0246 for a type that should exist), custom build tasks that create files but they are invisible to subsequent targets, globs not capturing build-generated files because they expand at evaluation time before execution creates them, ensuring generated files are cleaned by the Clean target. Covers correct BeforeTargets timing (CoreCompile,
Passed 22 of 22 test cases with the skill, and 15 of 22 without it.
and 10 more in the full report
7 fixed15 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 7 test cases the skill fixed. Same model, same prompt, with and without the skill.
Write an MSBuild target named `GenerateCodeAssets` that generates multiple `.cs` files into a subfolder of the intermediate output path and uses a glob pattern inside the target to register them all for compilation and clean.
| Checked | Without skill | With skill |
|---|---|---|
| The Compile item group uses a wildcard glob pattern inside the target | Missed | Passed |
| The FileWrites item group uses a wildcard glob pattern inside the target | Missed | Passed |
| The target uses BeforeTargets="CoreCompile;BeforeCompile" | Missed | Passed |
The instructions your model reads when the skill loads.
Files generated during the build are generally ignored by the build process. This leads to confusing results such as:
This happens because of how MSBuild's build phases work.
For code files generated during the build - we need to add those to Compile and FileWrites item groups within the target generating the file(s):
<ItemGroup>
<Compile Include="$(GeneratedFilePath)" />
<FileWrites Include="$(GeneratedFilePath)" />
</ItemGroup>
The target generating the file(s) should be hooked before CoreCompile and BeforeCompile targets - BeforeTargets="CoreCompile;BeforeCompile"
For detailed explanation, see How MSBuild Builds Projects.
MSBuild reads your project, imports everything, creates Properties, expands globs for Items outside of Targets, and sets up the build process.
MSBuild runs Targets & Tasks with the provided Properties & Items to perform the build.
Key Takeaway: Files generated during execution don't exist during evaluation, therefore they aren't found. This particularly affects files that are globbed by default, such as source files (.cs).
test cases passed, vs 15 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.