Property Inheritance in the IIS 6.0 Metabase

Applies To: Windows Server 2003, Windows Server 2003 with SP1

Property inheritance configures IIS by using as few property settings as possible. The benefits of using a minimal number of property settings to configure IIS are as follows:

  • Faster IIS cache performance

  • Reduced memory consumption

  • Reduced time required for IIS administration

Metabase properties are used to provide detailed control of IIS functionality. All metabase properties contain attributes, such as the DefaultValue attribute, which specify the configuration of the properties. Most metabase properties are inheritable, and they are specified as inheritable in MBSchema.xml by using the string value INHERIT as part of the value of the Attributes attribute. The following example shows the default attributes for the HttpErrors property in MBSchema.xml:

<Property
   InternalName = "HttpErrors"
   ID = "6008"
   Type = "MULTISZ"
   UserType = "IIS_MD_UT_FILE"
   Attributes = "INHERIT"
   MetaFlagsEx = "CACHE_PROPERTY_MODIFIED"
   DefaultValue = ""/
>

Hierarchical Relationship of Keys

The metabase is designed so that properties can be set differently at different keys. To understand how property inheritance works, it is necessary to first understand the hierarchical relationship of keys in the MetaBase.xml file. In relation to other keys, a key can be located in MetaBase.xml at a higher level, lower level, or the same level. The Location attribute of each key determines the level in which a key exists in the hierarchical structure.

The following example illustrates the relationship between the IIsWebService, IIsWebServer, and IIsWebVirtualDir keys. The example uses indentation to illustrate the hierarchical relationship of the keys.

<IIsWebService Location = "/LM/W3SVC"
   <IIsWebServer Location = "/LM/W3SVC/1">
      <IIsWebVirtualDir Location = "/LM/W3SVC/1/ROOT">
   <IIsWebServer Location = "/LM/W3SVC/2">
      <IIsWebVirtualDir Location = "/LM/W3SVC/2/ROOT">

In this example, the IIsWebService key is the highest-level key. The IIsWebServer keys are at a lower level than IIsWebService, and the IIsWebVirtualDir keys are at a lower level than the IIsWebServer keys. Keys that are at the same level cannot inherit properties from each other. Therefore, because the IIsWebServer keys are at the same hierarchical level in the metabase, they cannot inherit properties from each other. The IIsWebVirtualDir keys are also at the same level in relation to each other, and therefore they cannot inherit properties from each other.

Note

The hierarchical structure of the metabase is determined by the Location attribute of the keys themselves, not the class name of the keys.

Inheritance

Inheritable properties that are not explicitly set at a lower-level key are automatically inherited from the key at the next-higher level in which the property is configured. The IIS_ROOT key is the highest key in MetaBase.xml from which a property can be inherited.

The following example illustrates properties that are configured differently in different keys in MetaBase.xml, as well as properties that are inherited.

<IIsWebService Location = "/LM/W3SVC"
<!-- The DefaultDoc and ContentIndexed properties are specifically set at this key. -->
= "Default.htm,Default.asp,index.htm,Default.aspx"
ContentIndexed = "TRUE"
   <IIsWebServer Location = "/LM/W3SVC/1">
   <!-- The DefaultDoc property is specifically set at this key. -->
   = "Default.htm,Default.asp,index.htm,iisstart.htm,Default.aspx"
   <!-- The ContentIndexed property is inherited from the IIsWebService key and
   does not appear here -->
   </IIsWebServer>

<IIsWebVirtualDir Location = "/LM/W3SVC/1/ROOT"
<!-- The DefaultDoc and ContentIndexed properties are inherited from the /LM/W3SVC/1 location and do not appear here. -->
</IIsWebVirtualDir>
>
   <IIsWebServer Location = "/LM/W3SVC/2"
   <!-- The DefaultDoc and ContentIndexed properties are inherited from the
   IIsWebService key. -->
   </IIsWebServer>
   >
   <IIsWebVirtualDir Location = "/LM/W3SVC/2/ROOT"
   <!-- The DefaultDoc property is inherited from the /LM/W3SVC/2 location. -->
   <!-- The ContentIndexed property is specifically set at this key. -->
   ContentIndexed = "TRUE"
   >
</IIsWebVirtualDir>
</IIsWebService>