Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Whenever I add a Handler Mapping for a website in IIS7 Manager it always adds the handler to the site's local web.config file.

Is there a way to tell the manager to only add the handler mapping to the site configuration in applicationHost.config, for example:

<location path="Test Site">
    <system.webServer>
        <handlers>
            <clear />
            <add 
                name="PHP-FastCGI" 
                path="*.php" verb="GET,HEAD,POST" 
                modules="FastCgiModule" 
                scriptProcessor="c:\php\php-cgi.exe" 
                resourceType="Either" 
            />
            <-- Other handler mappings here -->
        </handlers>
        <security>
            <authentication>
                <anonymousAuthentication 
                    enabled="true" 
                    userName="i_test" 
                    password="[enc:AesProvider:snipped:enc]" 
                />
            </authentication>
        </security>
    </system.webServer>
</location>

I know how to do this using appcmd using the /commit:apphost switch but it'd be nice to achieve this via the UI.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

IIS Manager purposefully sets the setting at the lowest level that is allowed. Since you're allowed to have that set in the site's web.config, it will always apply it there.

IIS Manager itself does not give you a choice where to set it. The reason is that it would quickly become confusing and messy for the average administrator since a setting in applicationHost.config would be ignored if it's also set in web.config. So the cleanest way to ensure that there isn't confusion is to apply it at the lowest level allowed.

The solution (besides appcmd or editing applicationHost.config directly) is to use Configuration Editor from the IIS Admin pack (it's installed by default with IIS 7.5 on WS08 R2). That does allow you to choose where you want settings to be applied.

Actually, to be complete, although usually not a worthwhile option for handlers, you can turn off delegation for handlers for that site or the server. Then IIS Manager will set it in applicationHost.config.

share|improve this answer
    
Scott, thanks for the info. –  Kev Oct 14 '09 at 13:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.