Get Visual Studio to run a T4 Template on every build

后端 未结 22 2759
余生分开走
余生分开走 2020-11-22 08:29

How do I get a T4 template to generate its output on every build? As it is now, it only regenerates it when I make a change to the template.

I have found other ques

22条回答
  •  滥情空心
    2020-11-22 09:09

    Some guy built a nuget package for this.

    Side note: I get compile errors from both TextTemplate.exe and that package (because that package calls TextTemplate.exe) but not from Visual Studio. So apparently the behavior is not the same; heads up.

    EDIT: This ended up being my problem.

提交回复
热议问题