2014-03-19 68 views
9

我只是說這對我的web.config:允許「localhost」的在iisexpress運行時的web.config包含IPSECURITY權限

<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在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". 

我已經安裝IP安全對我的服務面板LOCALMACHINE,這樣就啓用了,我已經用在IPSECURITY塊選項周圍monkeyed如添加的「localhost」作爲一個domainName值 - 但唉,沒有運氣。 ....幫助我StackOverflow,你是我唯一的希望! ;)

+0

我也有這個問題,似乎無法找到解決的辦法 – Xoundboy

回答

12

我剛碰到相同的情況。我GOOGLE了四周,發現所有你需要做的就是編輯對ApplicationHost.config文件IIS快遞在這裏找到:

%USERPROFILE%\文件\ IISExpress \ CONFIG \對ApplicationHost.config

開放它查找ipSecurity部分是在system.webServer部分並將overrideModeDefault從「拒絕」更改爲「允許」。您無需從Windows功能添加IIS IP安全

<sectionGroup name="system.webServer"> 
    ... 
    <section name="ipSecurity" overrideModeDefault="Allow" /> 
    ... 
</sectionGroup> 

希望這有助於!

+0

這樣做,它似乎已經得到了我近一點 - 現在我收到以下錯誤:HTTP錯誤403.503 - 禁止 你做沒有權限查看此目錄或頁面。 – cardiac7

+1

403.502和503代碼與IIS中的IP限制模塊相關。我相信你可能會阻止自己。 (http://forums.iis.net/p/1210696/2075884.aspx?Re+IIS+8+IP+Restrictions+HTTP+403+503+Code) 編輯:哦等等!您必須將localhost添加到允許列表中。 AbeyMarquez

+4

必須有更多的東西。我已經在兩臺不同的個人電腦上嘗試過這種方式 - 而且這種方式無效。我仍然收到同樣的錯誤消息「此配置節不能用於此路徑。 – Gustin

相關問題