Attribute Element (Visual Studio Content Installer)
Specifies optional information about a component, such as programming language.
<VSContent>
<Content>
<Attributes>
<Attribute>
<Attribute>
<Attributes name="nnnn" value="nnn">
</Attribute>
Attributes and Elements
The following sections describe attributes, child elements, and parent elements.
Attributes
Attribute |
Description |
---|---|
name |
Specifies more information about the location of project templates and starter kits, or the language of code snippets. |
value |
Specifies the project type and subtype for Visual Studio project templates and starter kits, or the programming language for code snippets. |
Child Elements
None.
Parent Elements
Element |
Description |
---|---|
Attributes |
Specifies custom information about the component, which varies based on FileContentType. |
Text Value
A text value is required.
name Attribute Values
Value |
Description |
---|---|
ProjectType |
Specifies programming language of the project. |
ProjectSubType |
Specifies the subcategory in the New Project dialog box where the component will appear. |
TemplateType |
Defines whether a component is a project or a project item. |
Lang |
Specifies the programming language of a code snippet. |
value Attribute Values
Value |
Description |
---|---|
Visual Basic |
Specifies that the project or project item is for Visual Basic. Valid for name=ProjectType only. |
Visual C# |
Specifies that the project or project item is for Visual C#. Valid for name=ProjectType only. |
Visual J# |
Specifies that the project or project item is for Visual J#. Valid for name=ProjectType only. Note This value can only be used for Visual Studio 2005. |
Visual Web Developer |
Specifies that the project or project item is for Visual Web Developer. Valid for name=ProjectType only. |
CSharp |
Specifies that the custom project is to appear at the root of the Visual C# category in the New Project dialog box. Valid for name=ProjectSubType only. |
Visual Basic |
Specifies that the custom project is to appear at the root of the Visual Basic category in the New Project dialog box. Valid for name=ProjectSubType only. |
JSharp |
Specifies that the custom project is to appear at the root of the Visual J# category in the New Project dialog box. Valid for name=ProjectSubType only. Note This value can only be used for Visual Studio 2005. |
Web |
Specifies that the custom project is to appear at the root of the Visual Web Developer category in the New Project dialog box. Valid for name=ProjectSubType only. |
Project |
Specifies that the component is a project. Valid for name=TemplateType only. |
Item |
Specifies that the component is a project item. Valid for name=TemplateType only. |
|
Specifies that the code snippet was written in the C# language. Valid for name=lang only. |
|
Specifies that the code snippet was written in the J# language. Valid for name=lang only. Note This value can only be used for Visual Studio 2005. |
|
Specifies that the code snippet was written in Visual Basic. Valid for name=lang only. |
xml |
Specifies that the code snipped was written in XML. Valid for name=lang only. |
Remarks
Content with a FileContentType value of Addin, Macro Project, or Toolbox Control do not require any Attributes or Attribute elements.
Example
The following example shows the metadata for a project or starter kit community content component.
<VSContent xmlns="https://schemas.microsoft.com/developer/vscontent/2005">
<Content>
<FileName>MyProjectTemplate.zip</FileName>
<DisplayName>Sample Project Template</DisplayName>
<Description>A project template created for this example.</Description>
<FileContentType>VSTemplate</FileContentType>
<ContentVersion>2.0</ContentVersion>
<Attributes>
<Attribute name="ProjectType" value="Visual Basic"/>
<Attribute name="ProjectSubType" value=""/>
<Attribute name="TemplateType" value="Project"/>
</Attributes>
</Content>
</VSContent>