Visual Studio Content Installer Schema Reference
To install the contents of a packaged component, the Visual Studio Content Installer requires a .vscontent file, which is an XML file that describes the package's contents. The .vscontent file must follow a schema that contains the elements described in the table below. The package that contains the .vscontent file and other items is a .vsi file, and is typically referred to as a community component. For more information about .vscontent and .vsi files, see How to: Package Community Components to Use the Visual Studio Content Installer.
The following table describes the available elements of the .vscontent file schema.
| Element | Description | Child Elements | Attributes |
|---|---|---|---|
| VSContent | The root element of a .vscontent file. This element requires the xmlns attribute. | Content | xmlns Required value: http://schemas.microsoft.com/developer/vscontent/2005 |
| Content | A child element of the VSContent element. There must be at least one Content element in a .vscontent file. This element groups content in a .vscontent file. For example, if a Visual Studio Content Installer (.vsi) file contains both a Starter Kit and a code snippet, the Starter Kit is described inside one Content element, and the code snippet is described inside another Content element. | FileName DisplayName Description FileContentType ContentVersion Attributes | None |
| FileName | A child element of the Content element. There must be at least one FileName element in a Content element. This element contains the name of the content file. | None | None |
| DisplayName | A child element of the Content element. There must be exactly one DisplayName element in a Content element. This element contains the name of the content to display in the Visual Studio Content Installer. | None | None |
| Description | A child element of the Content element. There must be exactly one Description element in a Content element. This element contains a description of the content. The description appears as a ToolTip in the Visual Studio Content Installer. | None | None |
| FileContentType | A child element of the Content element. There must be exactly one FileContentType element in a Content element. This element contains the type of content. It must have one of the following values:
| None | None |
| ContentVersion | A child element of the Content element. There must be exactly one ContentVersion element in a Content element. You must specify 1.0 as the ContentVersion for all content. | None | None |
| Attributes | A child element of the Content element. There can be zero or more Attributes elements in a Content element. This element groups Attribute elements. Required for content with a FileContentType value of VSTemplate and content with a FileContentType value of Code Snippet. | Attribute | None |
| Attribute | A child element of the Attributes element. One or more Attribute elements are required in an Attributes element. This element contains additional custom information about the content. Attribute requires the name and value attributes. For example, the following code specifies that the Attribute element has a name attribute value of TemplateType and a value attribute value of Project.
<Attributes>
<Attribute name="TemplateType"
value="Project"/>
</Attributes>
| None | name value For examples, see How to: Publish Project Templates and How to: Publish Code Snippets. Content with a FileContentType value of VSTemplate requires one of the following Attribute element value combinations:
Content with a FileContentType value of Code Snippet requires the following Attribute element value combinations:
Content with a FileContentType value of Addin, Macro Project, or Toolbox Control do not require any Attributes or Attribute elements. |
The following example shows a .vscontent file for a .vsi file that contains a custom control. The following files would be included in the .vsi file for this content:
-
A .vscontent file that contains the XML shown in this example.
-
The compiled control .dll file MyButtonControl.dll.
The .dll file is installed in the following directory:
n:\...\Visual Studio 2005\Controls\
The control appears on the My Controls tab of the Toolbox by default.
<VSContent xmlns="http://schemas.microsoft.com/developer/vscontent/2005">
<Content>
<FileName>MyButtonControl.dll</FileName>
<DisplayName>My Custom Button</DisplayName>
<Description>A control created for this example.</Description>
<FileContentType>Toolbox Control</FileContentType>
<ContentVersion>1.0</ContentVersion>
</Content>
</VSContent>