【发布时间】:2020-06-11 08:27:43
【问题描述】:
Web.config 文件代码:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<system.webServer>
<httpErrors errorMode="DetailedLocalOnly">
</httpErrors>
</system.webServer>
<httpCookies httpOnlyCookies="true" />
<trace enabled="true" >
</trace>
<customErrors mode="RemoteOnly" />
<compilation debug="false" />
<authentication>
<forms cookieless="UseCookies" requireSSL="false" protection="Validation" />
</authentication>
<sessionState cookieless="UseUri" mode="StateServer" />s
</system.web>
</configuration>
在 Powershell 中运行 Get-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST/' -filter "system.webServer/httpErrors" -name "errorMode" 命令时出现错误消息:
Get-WebConfigurationProperty:文件名:\?\C:\inetpub\wwwroot\web.config
行号:4
错误:无法读取配置节“system.webserver”,因为它缺少节声明
【问题讨论】: