Archive for July, 2007
How to read/write administration.config
Jul 26th
IIS7 configuration system understands machine.config, web.config and applicationHost.config but does not handle administration.config natively. This means reading and writing administration.config is little difficult. If you use AhAdmin directly and call GetAdminSection for a section defined in administration.config, it will throw a configuration error for all configuration paths saying that it couldn’t find the section in the configuration file. Easiest way you can work with administration.config is by using Microsoft.Web.Administration (MWA). ServerManager::GetAdministrationConfiguration gives you a Configuration object which represents administration.config. Below is a sample program which uses MWA to print UI module providers registered in administration.config.
class Program
{
Working with RSCA using configuration APIs
Jul 25th
One of the new features in IIS7 in windows server 2008 enable people to extend existing IIS configuration sections. If you have a schema file in schema folder which defines section already defined in IIS_Schema.xml, IIS configuration system will merge the schema defined in these two files. This enables you to add owner, email, phone properties to sites and have then keep this data under sites section in applicationHost.config. In addition to this, there is a new concept of dynamic properties. These are the properties which doesn’t have static values in configuration files but whose values can be supplied dynamically by some COM components. Dynamic properties can support get/set operations as other configuration properties. Other than get and set, configuration system allows you to define methods in schema which can be called using configuration APIs. These methods can accept input and return output as well.