3

I am trying to add to the web.config the following section:

<location path="Test.aspx">
<system.web>
 <security>
    <authentication>
      <anonymousAuthentication enabled="false" />
      <windowsAuthentication enabled="true" />
    </authentication>
  </security>
</system.web>
</location>

But I get error "The configuration section 'security' cannot be read because it is missing a section declaration"

What am I doing wrong?

Hidalgo
  • 941
  • 2
  • 14
  • 38
  • It's been a long time since I edited a webconfig, but shouldn't you have a
    tag somewhere? The error message seems to indicate this...
    – Laurent S. Aug 15 '20 at 17:23
  • Can you add the rest of your web.config along with where you are trying to add this? Hard to tell without seeing the rest of it. – Selthien Aug 16 '20 at 04:40
  • Maybe this validator can help you https://elmah.io/tools/configvalidator/ – tontonsevilla Aug 16 '20 at 13:18
  • @Selthien The web.config is long. I am trying to add the above section AFTEr the tag. And it does not matter if I add the above section in the middle of the or after. The fact is that without the above section, no error. Thanks. – Hidalgo Aug 16 '20 at 21:29

0 Answers0