SortOrder Element (Visual Studio Templates)

Specifies a value that is used to arrange the template, among other templates in the same category, as it appears in either the New Project or Add New Item dialog box.

<VSTemplate> <TemplateData> <SortOrder>


<SortOrder> ... </SortOrder>

Attributes and Elements

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



Child Elements


Parent Elements

Element Description
TemplateData Required element.

Categorizes the template and defines how it displays in either the New Project or the Add New Item dialog box.

Text Value

A text value is required.

An integer that represents the sort order value.


SortOrder is an optional element. The default value is 100, and all values must be multiples of 10.

The SortOrder element is ignored for user-created templates. All user-created templates are sorted alphabetically.

Templates that have low sort order values appear in either the New Project or New Add Item dialog box before templates that have high sort order values.


The following example illustrates the metadata for a standard Visual C# class template.

<VSTemplate Type="Item" Version="3.0.0"
        <Description>My custom C# class template.</Description>

In this example, the SortOrder element is relatively high. It is likely that other Visual C# item templates will have a SortOrder value lower than 290 and will appear before this template in the New Item dialog box.

See Also