I suspect the issue is that you are not supporting incremental generation. Your TextTemplateTransform
target doesn't have inputs and outputs for the T4 files and the generated files, respectively.
Assuming that @(TextTemplate)
is a collection of .tt
files and that there is a one-to-one relation of .tt
to .generated.cs
, then modify the target definition as follows:
<Target Name="TextTemplateTransform" BeforeTargets="BeforeBuild" Inputs="@(TextTemplate)" Outputs="@(TextTemplate->'%(Filename).generated.cs')">
Is this a Windows specific build? You may want to consider using the Modeling SDK's text transformation targets file instead of writing and maintaining your own TextTemplateTransform
target. See "Invoke text transformation in the build process".