Share via


Property Inheritance

Property inheritance configures IIS 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, because less configuration information exists in the IIS cache while IIS is running.
  • Reduced memory consumed by IIS.
  • 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 a property. Most metabase properties are inheritable, and they are specified as inheritable in MBSchema.xml. Only properties that are defined in MBSchema.xml, using the string value "INHERIT" as part of the value of the Attributes attribute, can be inherited. The following sample 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=""/>

Each metabase property is described in detail in the Metabase Property Reference. This reference includes information about whether a property is inheritable, as well as the locations in which properties can be set in MetaBase.xml.

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. A key, in relation to other keys, 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. For more information about the hierarchical structure of MetaBase.xml, see the Metabase Configuration File.

Example 1

The following example illustrates the relationship between the IIsWebService, IIsWebServer, and IIsWebVirtualDir keys. Indentation is used in the example to help 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 Example 1, the IIsWebService key is the highest-level key. Likewise, 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 Note The hierarchical structure of the metabase is determined by the Location attribute of the keys themselves, not the class name of the keys. For more information about metabase structure, see the Metabase Configuration File.

Automatic Inheritance

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

Example 2

The following example illustrates properties that are configured differently in different keys in MetaBase.xml, as well as properties that are inherited. The names of properties that are set at a specific metabase key appear in bold text. Otherwise, the names of properties that are inherited from the next-highest key that has the inheritable property set, appear in plain text. Extensible Markup Language (XML) comments precede the property or properties to which they correspond.

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

FakePre-c43c2fbea4794dacaaff78d87a1b5bb5-baa9797161c24731a1454abd5197915b FakePre-a10586ce40c94ce4a8bc4a77401bc83d-4c882e734e9240dda9d1e8247ff29107 FakePre-dbcf2d7227414054bb60c62692cb5efa-2bee9d87db5146a4a2039798093952f8 FakePre-673e53e0791947aa9303bd51f88be0ca-871ae9f6e42b45b4ab7f74650fc48096