我正在尝试在调试版本中禁用自定义HTTP错误。我在Web.config
:
<configuration>
[...]
<system.webServer>
[...]
<httpErrors errorMode="Custom" existingResponse="Replace">
<remove statusCode="404" subStatusCode="-1" />
<remove statusCode="403" subStatusCode="-1" />
<remove statusCode="500" subStatusCode="-1" />
<error statusCode="403" path="/errors/403" responseMode="ExecuteURL" />
<error statusCode="404" path="/errors/404" responseMode="ExecuteURL" />
<error statusCode="500" path="/errors/500" responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>
</configuration>
这是Web.Debug.config
:
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
[...]
<system.webServer>
[...]
<httpErrors errorMode="Detailed" xdt:Transform="Replace"></httpErrors>
</system.webServer>
</configuration>
然而在Debug版本中我仍然得到自定义错误页面。此转换是否应该将httpErrors
元素替换为将其设置回详细错误消息的元素?
答案 0 :(得分:0)