我刚把它添加到我的web.config:
<security>
<ipSecurity allowUnlisted="false">
<!-- The following IP addresses are granted access, all else denied -->
<add allowed="true" ipAddress="123.123.105.0" subnetMask="255.255.255.0" />
<add allowed="true" ipAddress="123.123.100.0" subnetMask="255.255.255.0" />
</ipSecurity>
</security>
完全按预期工作,仅在某个IP范围内工作。但是,现在当我通过iisExpress通过localhost在Visual Studio中测试它时,它当然给了我一些问题。这是我收到的500.19错误:
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".
我在服务面板中的localmachine上设置了IPSecurity,因此启用了,我在ipSecurity块中添加了选项,例如添加'localhost'作为domainName值 - 但是没有运气。 ....帮我StackOverflow,你是我唯一的希望! ;)