We recommend using Visual Studio 2017

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


<SortOrder> ... </SortOrder>  

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



Child Elements


Parent Elements

TemplateDataRequired element.

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

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.

Visual Studio Template Schema Reference
Creating Project and Item Templates