Skip to content

Latest commit

 

History

History
77 lines (60 loc) · 2.98 KB

providedefaultname-element-visual-studio-templates.md

File metadata and controls

77 lines (60 loc) · 2.98 KB
title description ms.date ms.subservice ms.topic f1_keywords helpviewer_keywords author ms.author manager
ProvideDefaultName Element (Visual Studio Templates)
Learn about the ProvideDefaultName element and how it specifies if Visual Studio will generate a default Visual Studio name in the Add New Item or New Project dialog box.
11/04/2016
general-ide
reference
ProvideDefaultName element [Visual Studio project templates]
maiak
maiak
mijacobs

ProvideDefaultName element (Visual Studio templates)

Specifies whether the Visual Studio project system will generate a default name for the template in the Add New Item or New Project dialog box.

<VSTemplate> <TemplateData> <ProvideDefaultName>

Syntax

<ProvideDefaultName> true/false </ProvideDefaultName>

Attributes and elements

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

Attributes

None.

Child Elements

None.

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.

The text must be either true or false, indicating whether or not to generate a default name for the template in the Add New Item or New Project dialog box.

Remarks

ProvideDefaultName is an optional element. The default value is true.

If the ProvideDefaultName element is false, the Name boxes of the Add New Item and New Project dialog boxes contain the value <Enter_name>.

Use the DefaultName element to specify the default name of the project or item in the Add New Item and New Project dialog boxes. When the value of the ProvideDefaultName element is true, omission of the DefaultName element for projects populates the dialog box with the template's name, that is, the value from the Name element.

Example

The following code example sets the ProvideDefaultName element to false.

<VSTemplate Type="Item" Version="3.0.0"
    xmlns="http://schemas.microsoft.com/developer/vstemplate/2005">
    <TemplateData>
        <Name>MyClass</Name>
        <Description>My custom C# class.</Description>
        <Icon>Icon.ico</Icon>
        <ProjectType>CSharp</ProjectType>
        <ProvideDefaultName>false</ProvideDefaultName>
    </TemplateData>
    <TemplateContent>
        <ProjectItem>MyClass.cs</ProjectItem>
    </TemplateContent>
</VSTemplate>

See also