Delegating errorMode in httpErrors

Warning: This functionality is not currently working as expected in IIS 7.0. It is being addressed for the next release. In IIS 7.0 you can lock and unlock HTTP errors for particular sites or for the entire server; but, currently, "lockAllAttributesExcept="errorMode" is not working for httpErrors. Yet you can use the ideas in this article about unlocking particular attributes in other IIS configuration sections.

There are cases when a hoster may need to delegate to its customers specific settings in the “applicationhost.config” file without delegating the entire section, the errorMode setting in the httpErrors section is one of them, another one is the scriptErrorSentToBrowser setting in the ASP section. For troubleshooting purposes, a hoster’s customer may want to show Detailed Errors in remote clients. To enable it, the hoster would need to lock all attributes except errorMode (lockAllAttributesExcept="errorMode") and lock the error element (lockElements="error"). This way customers can change errorMode from "detailedLocalOnly" to "Detailed" and they would get Detailed Errors for all of their errors.

To Delegate the errorMode setting:

1. Allow the delegation of the <httpErrors> section in applicationhost.config via overrideModeDefault by opening "%windir%\system32\inetsrv\config\applicationhost.config" with a text editor and changing the <section name="httpErrors" overrideModeDefault="Deny" /> element as follows:

<section name="httpErrors" overrideModeDefault="Allow" />

2. Use lockAllAttributesExcept and lockElements to only allow the delegation of the errorMode setting, locate the <httpErrors> element and change as follows: