We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

Microsoft.VisualStudio.TextTemplating Namespace

The Microsoft.VisualStudio.TextTemplating namespace provides classes for the text template transformation functionality. The text template transformation engine is integrated into Visual Studio, and transforms text template files into generated text output files.

The text template transformation process takes a text template file as the input, performs the transformation on the input, and generates a new text file as the output. The engine component controls the process, and interacts with a text template transformation host and one or more text template directive processors to complete the process. For more information, see Code Generation and T4 Text Templates.

The text template transformation process has two steps. In the first step, the text template transformation engine creates a class that is referred to as the generated transformation class. In the second step, the engine compiles and executes the generated transformation class, to produce the generated text output. The generated transformation class is comprised of the code of the text template, that is, the statements, expressions, class features, and boilerplate text in the text template, and the results of calling directive processors. For more information, see Writing a T4 Text Template.

Advanced users might want to implement their own text template transformation engine host or directive processors. For more information, see:

Public classAssemblyCacheMonitorMonitors the state of the assembly cache.
Public classDirectiveProcessorThe abstract base class for a concrete directive processor.
Public classDirectiveProcessorAttribute
Public classDirectiveProcessorExceptionThe exception that is thrown by the text template transformation engine, if an error occurs while processing directives.
Public classEncodingHelperA utility class that gets the encoding of a file from its byte order mark.
Public classEngineThe text template transformation engine.
Public classParameterDirectiveProcessorDirective processor to route simple serializable parameters from callers or the host to the template.
Public classRequiresProvidesDirectiveProcessorThe abstract base class for a directive processor that defines and implements a design pattern called requires/provides.
Public classServiceProviderExtensionsClass that contains extensions to IServiceProvider relevant to T4 templates.
Public classShadowCopyMonitorMonitors the state of shadow-copied assemblies for use by hosts.
Public classSupportedDirectiveAttribute
Public classTextTemplatingSessionTrivial implementation of text transformation session interface
Public classTextTransformationThe abstract base class for all generated transformation classes. This class also provides utility methods and properties for use in text template code.
Public classToStringHelperA utility class that is used to produce a culture-specific representation of an Object as a String.
Public classTransformedAllTemplatesEventArgs
Public classTransformingAllTemplatesEventArgs

Public interfaceIDebugTextTemplatingEngine
Public interfaceIDebugTransformationRun
Public interfaceIDebugTransformationRunFactory
Public interfaceIDirectiveProcessorInterface for a directive processor.
Public interfaceIDirectiveProcessorMetadataMetadata provided by DirectiveProcessors. Hosts that want to import DPs via MEF can consume this standard metadata.
Public interfaceIRecognizeHostSpecificDirective Processors implement this method to obtain the state of the HostSpecific flag in a text template.
Public interfaceITextTemplatingEngineThe interface for the text template transformation engine.
Public interfaceITextTemplatingEngineHostThe interface for the host that transforms text templates. This is available to directive processors and can also be accessed by text templates.
Public interfaceITextTemplatingOrchestrator
Public interfaceITextTemplatingSessionCan be used to transmit information from a directive processor into a text template.
Public interfaceITextTemplatingSessionHostImplemented by a text templating host, enabling callers to obtain an object denoting the current session. A session represents series of executions of text templates. The session object can be used to pass information from the host into the code of the text template.