Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Visual Studio SDK
 How to: Specify File Output Types i...
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Domain-Specific Language Tools 
How to: Specify File Output Types in Text Templates 

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

  1. In Solution Explorer, right-click the text template file that you want to edit, and then click Open.

    The template opens in the editor.

  2. Add an output directive to the template.

    In the following example, a .vb output file will be generated:

    <#@ output extension=".vb" #>
    NoteNote

    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.

  3. Right-click the text template file, and click Run Custom Tool to generate the output file with the extension that you specified.

    NoteNote

    To debug text templates, you must set the debug parameter of the template directive. For more information, see How to: Debug Text Templates.

Security

For more information, see Security of Text Templates.

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker