Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Reference
 DefaultName Element (Visual Studio ...

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Visual Studio
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.

<DefaultName>
    Default Project Name
</DefaultName>

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.

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="2.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>
        <DefaultName>MyClass.cs</DefaultName>
    </TemplateData>
    <TemplateContent>
        <ProjectItem ReplaceParameters="true">MyClass.cs</ProjectItem>
    </TemplateContent>
</VSTemplate>
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker