Export (0) Print
Expand All
Expand Minimize

DefaultName Element (Visual Studio Templates)

Specifies the name that the Visual Studio project system will generate for the project or item when it is created.

    Default Project Name

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



Child Elements


Parent Elements




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

This text specifies the default name of the project or item.

DefaultName is an optional element.

For projects, this element specifies the name of the directory that stores the project on disk. For items, it specifies the file name of the source file.

When you create a project or item, you can modify the default name using the Name option, which is available from either the New Project dialog box or Add New Item dialog box.

If you do not want the project system to generate the default name for the project or item, then set the ProvideDefaultName element to False.

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

<VSTemplate Type="Item" Version="3.0.0"
        <Description>My custom C# class.</Description>
        <ProjectItem ReplaceParameters="true">MyClass.cs</ProjectItem>
© 2014 Microsoft