Datasheet
There are two great benefits to this new configuration style in IIS 7.0. The first is that by not using the
registry for configuration, deploying a site and applications can be done by using XCopy to transfer both
content and configuration settings. This makes deployment across web farms far easier than trying to
export/import metabase settings. It also speeds deployment to remote servers and provides for simpli-
fied customer installations of custom web-site applications that include specific web-site configurations.
The second benefit to this process is that developers can be allowed to modify the configuration files for
their applications, determining the IIS configuration requirements necessary. This modification can be dele-
gated so that required settings cannot be changed, and the settings are hierarchical, thus server settings cas-
cade to the site and on to the application level, pending modifications allowed at lower levels. Developers
accustomed to using configuration files for their applications need not learn IIS administration, and admin-
istrators can allow developers the flexibility they need while still maintaining overall control.
Extensible Configuration Schemas
IIS 7.0 configurations can be extended quite easily with the new configuration model. Suppose you want
to create a new module for IIS. You would need to point to the module’s DLL in the
<globalModules>
section of the applicationHost.config file and declare the module in either the
applicationHost.config or the appropriate web.config file. Extending the configuration schema
for your new module is as simple as creating the schema file in the
inetsrv\config\schema folder on
the system. Getting IIS to recognize and use the schema is done by adding a section for the module
under the
<configSections> section of applicationHost.config.
For example, you might add the following to the
<globalModules> section:
<globalModules>
<add name=”MyNewModule” image=”c:\modules\MyNewModule.dll” />
....
</global Modules>
The following would need to be added to the <modules> section of the applicationHost.config file
or to the
web.config file for the individual site in which the module would be used:
<modules>
<add name=”MyNewModule” />
....
</modules>
Then you would need to create a new schema file, MyNewModule.xml, in the inetsrv\config\schema
folder for your new module:
<configSchema>
<sectionSchema name=”MyNewModule”>
<attribute name=”enabled” type=”bool” defaultValue=”false” />
<attribute name=”message” type=”string” defaultValue=”Hello World!” />
</sectionSchema>
</configSchema>
Finally, you need to register the section on the system in applicationHost.config, as follows:
<configSections>
13
Chapter 1: Background on IIS and New Features in IIS 7.0
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 13