You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using VS or Rider's built-in text templating, this produces an output <filename>.gen.cs. But when using T4.Build, it outputs <filename>.gen.gen.cs.
Solution (my guess)
I don't know how to debug an msbuild task, but looking through the code it appears this is caused by (T4.Build) BuildTemplateGenerator.OutputFile doing a Path.ChangeExtension before (Mono.TextTemplating) TemplateGenerator.SetFileExtension does the same thing.
When using an ordinary extension (.xyz) the double-call doesn't change anything. When using a doubled extension (.xyz.abc) the "sub"-extension gets doubled up, resulting in the <filename>.gen.gen.cs I mentioned above.
My guess on a fix would be, within BuildTemplateGenerator.OutputFile, to only change extension if no output directive is found.
The text was updated successfully, but these errors were encountered:
Problem
I have this directive in my .tt file:
<#@ output extension=".gen.cs" #>
When using VS or Rider's built-in text templating, this produces an output
<filename>.gen.cs
. But when using T4.Build, it outputs<filename>.gen.gen.cs
.Solution (my guess)
I don't know how to debug an msbuild task, but looking through the code it appears this is caused by (T4.Build)
BuildTemplateGenerator.OutputFile
doing aPath.ChangeExtension
before (Mono.TextTemplating)TemplateGenerator.SetFileExtension
does the same thing.When using an ordinary extension (.xyz) the double-call doesn't change anything. When using a doubled extension (.xyz.abc) the "sub"-extension gets doubled up, resulting in the
<filename>.gen.gen.cs
I mentioned above.My guess on a fix would be, within
BuildTemplateGenerator.OutputFile
, to only change extension if nooutput
directive is found.The text was updated successfully, but these errors were encountered: