We recommend using Visual Studio 2017

ProjectTemplateLink Element (Visual Studio Templates)


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at ProjectTemplateLink Element (Visual Studio Templates).

Specifies the path to the .vstemplate file of one project in a multi-project template.


<ProjectTemplateLink ProjectName="Name">  

The following sections describe attribute, child elements, and parent elements.


ProjectNameOptional attribute.

Specifies the name for each individual project in a multi-project template. The New Project dialog box cannot assign names to individual projects.
CopyParametersEnables all the variables in the main group template to be copied to each of the linked templates.

The parameters in the linked templates have a prefix "$ext_*$". For example, if in the parent group template the parameter $projectname$ has a value ExampleProject1, when the linked template gets its turn to be executed, it acquires a parameter $ext_projectname$, which is a copy of the $projectname$ parameter from the parent group template.

This enables linked templates to share some common parameters, which may be conveniently created only in the parent group template.

This attribute is optional, and it automatically defaults to false when it is not included.

Introduced in Visual Studio 2013 Update 2. To reference the correct product version, see Referencing Assemblies Delivered in the Visual Studio 2013 SDK Update 2.

Child Elements


Parent Elements

ProjectCollectionSpecifies the organization and contents of multi-project templates.
SolutionFolderGroups projects in multi-project templates.

A text value is required.

This text specifies the path to the .vstemplate file of the template.

Multi-project templates act as containers for two or more projects. The ProjectTemplateLink element is used to specify the location of the .vstemplate file for one of the projects in the template. The .vstemplate file of a multi-project template contains one ProjectTemplateLink element for each project in the template. For more information on multi-project templates, see How to: Create Multi-Project Templates.

This example shows a simple multi-project root .vstemplate file. In this example, the template contains two projects, My Windows Application and My Class Library. The ProjectName attribute on the ProjectTemplateLink element sets the name for Visual Studio to assign this project. If the ProjectName attribute does not exist, the name of the .vstemplate file is used as the project name.

<VSTemplate Version="3.0.0" Type="ProjectGroup"  
        <Name>Multi-Project Template Sample</Name>  
        <Description>An example of a multi-project template</Description>  
            <ProjectTemplateLink ProjectName="My Windows Application">  
            <ProjectTemplateLink ProjectName="My Class Library" CopyParameters="true">  

Visual Studio Template Schema Reference
Creating Project and Item Templates
How to: Create Multi-Project Templates