The Structure of the Content_types].xml File

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at The Structure of the [Content_types].xml File.

Contains information about the kinds of content in a VSIX package. Visual Studio uses the [Content_Types].xml file to install the package, but it does not install the file itself.

System_CAPS_ICON_note.jpg Note

Although this topic applies only to [Content_Type].xml files that are used in VSIX packages, the [Content_Types].xml file type is part of the Open Packaging Conventions (OPC) standard. For more information, see OPC: A New Standard For Packaging Your Data on the MSDN Web site.

The following sections describe the root element and its attributes and child elements.

Root Element

ElementDescription
TypesContains child elements that enumerate the file types in the VSIX package.

Attributes

AttributeDescription
Xmlns(Required.) The location of the schema used for this [Content_Types].xml file.

{Attribute name} Attribute

ValueDescription
http://schemas.openformats.org/package/2006/content-typesThe location of the content types schema.

Child Elements

The Types element can contain any number of Default elements.

ElementDescription
DefaultDescribes a content type in the VSIX package. Every file type in the package must have its own Default element.

Attributes

AttributeDescription
ExtensionThe file name extension of a file in the VSIX package.
ContentTypeDescribes the kind of content that is associated with the file name extension.

{Attribute name} Attribute

Visual Studio recognizes the following ContentType values for the associated Extension types.

ExtensionContentType
txttext/plain
pkgdeftext/plain
xmltext/xml
vsixmanifesttext/xml
htm or htmltext/html
rtfapplication/rtf
pdfapplication/pdf
gifimage/gif
jpg or jpegimage/jpg
tiffimage/tiff
vsixapplication/zip
zipapplication/zip
dllapplication/octet-stream
all other file typesapplication/octet-stream

Description

The following [Content_Types].xml file describes a typical VSIX package.

Code

<?xml version="1.0" encoding="utf-8" ?>   
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">  
    <Default Extension="vsixmanifest" ContentType="text/xml" />   
    <Default Extension="dll" ContentType="application/octet-stream" />   
    <Default Extension="png" ContentType="application/octet-stream" />   
    <Default Extension="txt" ContentType="text/plain" />   
    <Default Extension="pkgdef" ContentType="text/plain" />   
</Types>  

Anatomy of a VSIX Package
VSIX Extension Schema 1.0 Reference
OPC: A New Standard For Packaging Your Data

Show: