【发布时间】: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