ITextTemplatingEngineHost Interface

The interface for the host that transforms text templates. This is available to directive processors and can also be accessed by text templates.

Namespace:  Microsoft.VisualStudio.TextTemplating
Assembly:  Microsoft.VisualStudio.TextTemplating (in Microsoft.VisualStudio.TextTemplating.dll)

public interface ITextTemplatingEngineHost

A host takes a text template file as the input and produces a text file as output. A typical host is the TextTemplatingFileGenerator tool that transforms templates in a Visual Studio project. It calls one or more directive processors to deal with different types of template. The members of this interface are accessible to the directive processors, and to the code of the text template. The text template engine controls this process and interacts with a host and one or more directive processors. To learn more about these components, see Generating Artifacts By Using Text Templates.

To make the host accessible to the code of a text template, set the hostspecific parameter of the template directive. For example:

<#@template language="c#" hostspecific="true" #>
<# // This template is specific to the TextTemplatingFileGenerator host,
   // which transforms templates in a Visual Studio project. #>
These are the projects in this solution:
<#=this.Host.ResolveParameterValue("-", "-", "projects") #>

If you want to use text templates outside Visual Studio or with custom tools, you can write a custom host, implementing this interface. For an example, see Walkthrough: Creating a Custom Text Template Host.




Clarified some method descriptions.

Information enhancement.

Community Additions