【问题标题】:IIS Express applicationhost.config - authentication errorIIS Express applicationhost.config - 身份验证错误
【发布时间】:2019-01-30 22:21:51
【问题描述】:

我在 Windows 10 下运行 IIS Express(不要与普通 IIS 混淆)。我的理解是设置存储在“My Documents\IISExpress\config\applicationhost.config”中

在使用创建 asp.net 核心项目时,本地 web.config 文件可以覆盖这些设置。

尝试使用此 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>

我收到以下错误。

此配置部分不能用于此路径。当该部分锁定在父级别时会发生这种情况。锁定是默认情况下 (overrideModeDefault="Deny"),或由具有 overrideMode="Deny" 或传统 allowOverride="false" 的位置标记显式设置。

识别这一行

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

尽管将此行更改为允许状态

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

我还有其他地方应该去看看吗?

【问题讨论】:

标签: asp.net windows asp.net-core iis-express


【解决方案1】:

根据收到的反馈。

在 Visual Studio 中工作时,配置文件的正确位置是 {ProjectDirectory}.vs\config\applicationhost.config。

“我的文档\IISExpress\config\applicationhost.config”不正确

【讨论】:

    猜你喜欢
    • 2011-06-13
    • 2016-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-17
    • 1970-01-01
    • 1970-01-01
    • 2018-05-28
    相关资源
    最近更新 更多