Udostępnij za pośrednictwem


How to: Create a Project Template Using the Projectgen.exe Command-Line Tool

You can use the Projectgen.exe command-line tool to create project templates for your host application. Before you can use the Projectgen.exe command-line tool, you must have a project template descriptor file. You can create this file manually, or you can run the Projectgen.exe wizard to automatically generate the descriptor file. For more information, see Walkthrough: Creating a Project Template Using the Project Template Wizard. After you have created the descriptor file, you can use it as an input parameter for the Projectgen.exe command-line tool.

Note

The project template that Projectgen.exe generates contains paths to files based on the file locations on your computer. If end user computers might have different file locations, you must modify the project template so that it uses correct paths. For example, you can replace paths with variables. For more information about variables, see Project Template Generation Tool (Projectgen.exe).

To create a project template

  1. Open the Visual Studio 2008 Command Prompt window. If you are using Windows Vista as your operating system, start the Visual Studio 2008 Command Prompt window by using the Run as Administrator option.

  2. Change to the following directory:

    %ProgramFiles%\Visual Studio Tools for Applications 2.0 SDK\build number\Visual Studio Tools For Applications\Tools\ProjectGen
    

    Note

    This path assumes that you installed the Microsoft Visual Studio Tools for Applications 2.0 SDK to the default directory.

  3. Type the following command and then press ENTER:

    projectgen.exe /i:%SYSTEMDRIVE%\ShapeAppSamples\ShapeAppCSharp\ProjectDescriptor.xml /o:%SYSTEMDRIVE%\ShapeAppSamples\ShapeAppCSharp\Templates
    

For information about the command parameters, see Project Template Generation Tool (Projectgen.exe).

Compiling the Code

This example requires the following components:

  • A project template descriptor file named ProjectDescriptor.xml in a directory named drive:\ShapeAppSamples\ShapeAppCSharp.

  • A directory named drive:\ShapeAppSamples\ShapeAppCSharp\Templates to store the generated templates.

See Also

Tasks

Walkthrough: Creating a Project Template Using the Project Template Wizard

Concepts

Creating Project Templates (Visual Studio Tools for Applications)

Creating Project Templates Using the Project Template Generation Tool (Projectgen.exe)

Reference

Descriptor Schema for Projectgen.exe

Proxy Generation Tool (ProxyGen.exe)