Export (0) Print
Expand All

How to: Publish Project Templates 

To get a template to appear in the New Project dialog box, it must be placed in the correct location on a user's computer. To make this process easier, you can place your template .zip file inside of a Visual Studio Installer (.vsi) file, and let the Visual Studio Content Installer place the file in the correct location. The .vsi file can then be easily shared with other developers throughout the community.

.VSI Files

Visual Studio Installer (.vsi) files are used to exchange Visual Studio content in the developer community. A .vsi file is a renamed .zip file that contains:

The Visual Studio Content Installer uses .vsi files to install shared content to the proper location. For more information on installing .vsi files, see How to: Install Community Components.

You must set specific values and attributes in the .vscontent file for the Visual Studio Content Installer to know how and where to install the template. In the .vscontent file for a template, you must:

  • Set the FileContentType element value to VSTemplate.

  • Add Attribute elements with the following attributes.

    • ProjectType: Specifies the project type, either Visual Basic, Visual C#, Visual J#, or Visual Web Developer.

    • ProjectSubType: Specifies the subcategory in which to place the template in the New Project dialog box.

    • TemplateType: Specifies the type of template, either Project or Item.

To create a template .vsi file

  1. Create a valid .vscontent file for the content. For more information on the .vscontent file schema, see How to: Package Community Components to Use the Visual Studio Content Installer.

  2. Select the files to include in the .vsi file (including the .vscontent file) right-click, select Send To, and click Compressed (zipped) Folder. The selected files are compressed into a single .zip file.

  3. Rename the extension of the .zip file to .vsi.

    NoteNote

    To display publisher information for your project template in the Visual Studio Content Installer, you must sign the .vsi file. For more information, contact a Digital Certificate vendor.

Example

The following example shows a .vscontent file for a .vsi that contains a project template. The following files would be included in the .vsi file for this content.

  • A .vscontent file with the code from this example.

  • The project template MyProjectTemplate.zip.

The template will be installed in the root Visual Basic category of the New Project dialog box. To install the template in a Visual Basic subcategory, use the subcategory name as the value of the ProjectSubType attribute.

<VSContent xmlns="http://schemas.microsoft.com/developer/vscontent/2005">
    <Content>
        <FileName>MyProjectTemplate.zip</FileName>
        <DisplayName>Sample Project Template</DisplayName>
        <Description>A project template created for this example.</Description>
        <FileContentType>VSTemplate</FileContentType>
        <ContentVersion>1.0</ContentVersion>
        <Attributes>
            <Attribute name="ProjectType" value="Visual Basic"/>
            <Attribute name="ProjectSubType" value=""/>
            <Attribute name="TemplateType" value="Project"/>
        </Attributes>
    </Content>
</VSContent>

See Also

Community Additions

ADD
Show:
© 2015 Microsoft