T4 Import Directive
Updated: March 2011
In the code blocks of a Visual Studio T4 text template, the import directive allows you to refer to elements in another namespace without providing a fully-qualified name. It is the equivalent of using in C# or imports in Visual Basic.
For a general overview of writing T4 text templates, see Writing a T4 Text Template.
The following namespace is imported automatically, so that you do not need to write an import directive for it:
In addition, if you use a custom directive, the directive processor might import some namespaces automatically.
For example, if you write templates for a domain-specific language (DSL), you do not need to write import directives for the following namespaces:
Your DSL’s namespace