Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Implementing Single File Generators

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

A custom tool — sometimes referred to as a single file generator — can be used to extend the Visual Basic, Visual C#, and Visual J# project systems in Visual Studio. A custom tool is a COM component that implements the IVsSingleFileGenerator interface. Using this interface, a custom tool transforms a single input file into a single output file. The result of the transformation may be source code, or any other output that is useful. Two examples of custom tool-generated code files are code generated in response to changes in a visual designer and files generated using Web Services Description Language (WSDL).

When a custom tool is loaded, or the input file is saved, the project system calls the Generate method, and passes a reference to a IVsGeneratorProgress callback interface, whereby the tool can report its progress to the user.

The output file that the custom tool generates is added to the project with a dependency on the input file. The project system automatically determines the name of the output file, based on the string returned by the custom tool's implementation of DefaultExtension.

A custom tool must implement the IVsSingleFileGenerator interface. Optionally, custom tools support the IObjectWithSite interface to retrieve information from sources other than the input file. In any case, before you can use a custom tool, you must register it with the system or in the Visual Studio local registry. For more information on registering custom tools, see Registering Single File Generators.

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.