Get Visual Studio to run a T4 Template on every bu

2018-12-31 10: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 questions similar to this:

T4 transformation and build order in Visual Studio (unanswered)

How to get t4 files to build in visual studio? (answers are not detailed enough [while still being plenty complicated] and don't even make total sense)

There has got to be a simpler way to do this!

19条回答
只若初见
2楼-- · 2018-12-31 11:15

Probably the simplest way is to install a Visual Studio extension called AutoT4.

It runs all T4 templates on build automagically.

查看更多
登录 后发表回答