Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use T4 programmatically from C#?

I am writing software that produces C# code. Mostly I am using StringTemplate and StringBuilder.

Is there any way to use T4 templates direct from my code?

like image 472
Đorđe Avatar asked Oct 23 '09 11:10

Đorđe


1 Answers

Oleg Sych describes how to do this here: Understanding T4: Preprocessed Text Templates. Note that it looks like you'll need Visual Studio 2010 to generate a preprocessed Text Template, but you'll be able to host the preprocessed Text Template wherever you like - including within your WinForms application.

like image 183
Dan Blanchard Avatar answered Oct 24 '22 15:10

Dan Blanchard