The T4 Templating Engine

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies.
This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

T4 (Text Template Transformation Toolkit) is used to expand text templates using code written in C# or Visual Basic .NET. The T4TemplatingEngine component, highlighted in Figure 1, is a replaceable component of the Recipe Framework.

Figure 1: The T4 templating engine

Ff697233.0b409029-ae8d-48d6-af87-e9e7f352a177(en-us,PandP.10).png

The T4 templating engine takes text strings interleaved with scriptlets (expressions in Visual Basic or C#) as input and returns a string. The scriptlets are used dynamically create strings that are directly inserted into the output stream of the template. The most common use of T4 templating is generating code of a class or an XML file. For more information about the syntax of a T4 template, see Syntax of T4 Templates.

See also

Components of the Guidance Automation Toolkit | The Recipe Framework Foundation | The Wizard Framework Extension | Guidance Package Management UI