Reference 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 Reference Element (Visual Studio Templates).

Specifies the assembly reference to add when the item is added to a project.

<VSTemplate>
<TemplateContent>
<References>
<Reference>

<Reference>  
    <Assembly> ... </Assembly>  
</Reference>  

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

Attributes

None.

Child Elements

ElementDescription
AssemblyRequired element.

Specifies information about an assembly, which the template uses to add a reference of that assembly to projects. There must be one Assembly element in every Reference element.

Parent Elements

ElementDescription
ReferencesGroups the assembly references that the template adds to projects.

Reference is a required child element of References.

The Reference and References elements can only be used in .vstemplate files that have a Type attribute value of Item.

The following example illustrates the TemplateContent element of an item template. This XML adds references to the System.dll and System.Data.dll assemblies.

<TemplateContent>  
    <References>  
        <Reference>  
            <Assembly>  
                System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089  
            </Assembly>  
        </Reference>  
        <Reference>  
            <Assembly>  
                System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089  
            </Assembly>  
        </Reference>  
    </References>  
    ...  
</TemplateContent>  

Visual Studio Template Schema Reference
Creating Project and Item Templates

Show: