0

I want to add the local host ip address to the list of allowed ip addresses for my site in web.config, so that when I start up the local debugger in IIS Express I'm not blocked. I'm following these two pages with no luck. link and link

So I added it like this, but it still blocks me.

<security>
  <ipSecurity allowUnlisted="false" denyAction="NotFound">
    <add allowed="true" ipAddress="127.0.0.1" subnetMask="255.255.255.255" /> 
    // my true ip address
    <add allowed="true" ipAddress="24.130.112.30" subnetMask="255.255.0.0" />


  </ipSecurity>
</security>

I also tried adding

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

in the applicationhost.config file in wondows.

But I'm still getting this error message in the browser

enter image description here

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
chuckd
  • 13,460
  • 29
  • 152
  • 331
  • please refer to my two links, that include the one you used. I've already tried it – chuckd Mar 22 '18 at 22:00
  • If you have followed all suggestions in the link, have you considered employing web.config transformation. Essentially putting the section in only in production? https://msdn.microsoft.com/en-us/library/dd465326.aspx – Steve0 Mar 23 '18 at 14:54

1 Answers1

0

I had exactly the same issue as you. I read somewhere that there can also be an applicationhost.config file stored in your projects .vs\config\ folder. I changed the overrideModeDefault value in this file and everything started working.

envio
  • 1,315
  • 2
  • 10
  • 13