Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS Express applicationhost.config - authentication error

I'm running IIS Express (not to be confused with the normal IIS) under Windows 10. My understanding is the settings are stored in "My Documents\IISExpress\config\applicationhost.config"

These settings can be overriden by a local web.config file when using creating an asp.net core project.

When attempting to use this web.config

<?xml version="1.0" encoding="utf-8"?>
 <configuration>
  <location path="" inheritInChildApplications="false">
    <system.webServer>
      <security>
        <authentication>
          <anonymousAuthentication enabled="false" />
          <windowsAuthentication enabled="true" />
        </authentication>
      </security>
    </system.webServer>
  </location>    
</configuration>

I receive the following error.

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

identifying this line

<authentication>
**<anonymousAuthentication enabled="false" />**
<windowsAuthentication enabled="true" />

This in spite of changing this line to state allow

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

Is there any other place I should be looking?

like image 676
ffejrekaburb Avatar asked Jul 13 '26 12:07

ffejrekaburb


1 Answers

Based upon feedback received.

The correct location for the configuration file is {ProjectDirectory}.vs\config\applicationhost.config when working within visual studio.

"My Documents\IISExpress\config\applicationhost.config" is incorrect

like image 158
ffejrekaburb Avatar answered Jul 17 '26 20:07

ffejrekaburb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!