Section is locked (ipSecurity configuration)

Module IpRestrictionModule
Notification BeginRequest
Handler ExtensionlessUrl-Integrated-4.0
Error Code 0x80070021
Config Error This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault=”Deny”), or set explicitly by a location tag with overrideMode=”Deny” or the legacy allowOverride=”false”.

Update file: applicationhost.config (%userprofile%\documents\iisexpress\config\applicationhost.config)

Change line:
<section name=”ipSecurity” overrideModeDefault=”Deny” />

To:
<section name=”ipSecurity” overrideModeDefault=”Allow” />

And in web.config use:

<system.webServer>
<security>
<ipSecurity allowUnlisted=”false” denyAction=”Unauthorized”>
<clear/>
<add ipAddress=”X.X.X.X” allowed=”true” subnetMask=”255.255.255.0″ />
</ipSecurity>
</security>
</system.webServer>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.