Pregunta

I hope microsoft puts some more document on how to use T4 Templates and some scenarios . Is it possible to use T4 Text templates on a machine which doesnt have visual studio installed but only .NET 4.5 framework ? I have a windows service into which I want to use Preprocessed Templates. If yes , will it compile .tt files in to service exe or do we deploy .tt files seperately ? Also can be be used in a web application ?

¿Fue útil?

Solución

A "RuntimeTextTemplate" uses TextTemplatingFilePreprocessor to generate C# from a T4 file that can be executed anywhere to generate the text artifact (this is different from TextTemplatingFileGenerator which generate the text artifact when saving the T4 file in VS).

AFAIK TextTemplate.exe can't be redistributed (GarethJ knows) so generating text artifacts from T4 using that tool on a non-VS machine is prohibited.

Mono has their own T4 Engine which potentially could be used instead.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top