tags:

views:

236

answers:

3

Consider a .NET application that performs lots of configuration changes in IIS such as changing Virtual Directories or enabling compression. With IIS6 everything could be accomplished using the metabase through DirectoryServices.

However in IIS7, the Metabase compatiblity is an optional component, so I'm assuming that alternative ways should be used in order to programmatically perform configuration changes. What's the right way of doing those? Should I directly edit the applicationHost.config file or is there a recommended API?

+2  A: 

I believe Microsoft.Web.Administration has what you are looking for.

bobbymcr
+1  A: 

You could use :

Jerome Laban
A: 

Other alternative is WMI or use of C# to send commands via appcmd.exe. See some tips at Add an ISAPI Filter (IIS 7)

lsalamon