car*_*ac7 12 web-config localhost iis-express visual-studio-2013
我刚把它添加到我的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>
Run Code Online (Sandbox Code Playgroud)
完全按预期工作,仅在某个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".
Run Code Online (Sandbox Code Playgroud)
我已在服务面板中的localmachine上设置了IPSecurity,因此启用了,我已经在ipSecurity块中添加了选项,例如添加'localhost'作为domainName值 - 但是没有运气.....帮我StackOverflow,你是我唯一的希望!;)
Abe*_*uez 15
我刚遇到同样的情况.我搜索了一下,发现你所要做的就是编辑IIS Express 的applicationhost.config文件:
%USERPROFILE%\文件\ IISExpress \设置\对ApplicationHost.config
打开它并查找system.webServer部分中的ipSecurity部分,并将overrideModeDefault从"Deny" 更改为"Allow".您无需从Windows功能添加IIS IP安全性.
<sectionGroup name="system.webServer">
...
<section name="ipSecurity" overrideModeDefault="Allow" />
...
</sectionGroup>
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助!
归档时间: |
|
查看次数: |
5001 次 |
最近记录: |