Introduction
Extensibility was not a priority on the IIS 6.0 feature list. The IIS team had to deal with more urgent issues: improving security, reliability and performance. IIS 6.0 is a huge step forward with regard to these particular issues.
IIS 7.0 brings additional improvements in these areas, but the revolution happens in the extensibility domain. It has never been so easy to plug code deep into the IIS core pipeline and extend IIS in ways that were impossible before.
To give some examples: a few lines of code allows developers to write modules or handlers that provide new authentication and authorization schemes, do run-time or security analysis of incoming request and inspect responses. But to provide a real value-add, these modules must be manageable via programming interfaces, command-line tools and a user interface.
This white paper is an end-to-end example of how to extend the IIS 7.0 web server with a custom request handler. It shows how to add API and command-line support for the configuration of this handler and how to write a user interface module plugs into the IIS Management interface.
The solution has been tested on Windows Vista and Windows Server® 2008 Beta 3. It will be updated once the final version of Windows Server 2008 is available.
Feature Set:
- Managed handler inserts a copyright message into image files
- Copyright message feature is configuration driven and uses the new IIS 7.0 configuration system
- Configuration can be schematized and made accessible to configuration APIs, WMI scripting and IIS command-line tools
- User Interface Extension Module allows configuration of copyright message feature through the IIS 7.0 user interface
Prerequisites
To follow the steps in this document, the following software must be installed.
ASP.NET
Install ASP.NET via the Windows Vista Control Panel. Select "Programs" - "Turn on or off Windows features". Then open "Internet Information Services" - "World Wide Web Services" - Application Development Features" and check "ASP.NET.
If you have a Windows Server 2008 build. open "Server Manager" - "Manage Roles" and select "Web Server (IIS)". Click "Add role services". Under "Application Development" check "ASP.NET".
You must also install "IIS Management Scr