Export (0) Print
Expand All

How to: Import Namespaces in Text Templates

Updated: July 2008

The import directive lets you specify the namespaces that you want to use in those text templates. For more information, see Directive Syntax (Domain-Specific Languages).

You can add a namespace to a text template so that you do not have to use fully-qualified names in the code in your text template.

To import a namespace

  • Specify a namespace by using the import directive, as shown in the following example.

    <#@ import namespace = "System.Collections.Generic" #>

The following example shows how to use the import directive.

<#@ import namespace = "System.Collections.Generic" #>
    List<string> names=new List<string>();




July 2008

Rewrote and refactored project.

Content bug fix.

Community Additions

© 2014 Microsoft