You can add an output directive to text templates that indicates the type of file that you want the template to generate. For more information, see Directive Syntax (Domain-Specific Languages).
To specify the output file type in a text template file
-
In Solution Explorer, right-click the text template file that you want to edit, and then click Open.
The template opens in the editor.
-
Add an output directive to the template.
In the following example, a .vb output file will be generated:
<#@ output extension=".vb" #>
Note |
|---|
| You can specify any appropriate file type extension (for example, .vb, .txt, .htm, and so on). If no output directive is used, the output file will have a .cs extension by default. |
-
Right-click the text template file, and click Run Custom Tool to generate the output file with the extension that you specified.
Note |
|---|
| To debug text templates, you must set the debug parameter of the template directive. For more information, see How to: Debug Text Templates. |
Security
See Also