This documentation is archived and is not being maintained.

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

Visual Studio 2008

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.

NoteNote:

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
    
    NoteNote:

    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).

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.

Show: