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?
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.