httperrors existingResponse="Auto" 不提供自定义页面

Sal*_*man 5 asp.net-mvc http-error

我正在尝试在出现自定义错误时显示自定义页面。

这是我的配置:

<httpErrors existingResponse="Auto" defaultResponseMode="ExecuteURL" errorMode="Custom">
    <clear/>
    <remove statusCode="403"/>
    <error statusCode="403" responseMode="ExecuteURL" path="/403.html"/>
    <remove statusCode="404"/>
    <error statusCode="404" responseMode="ExecuteURL" path="/404.html"/>
    <remove statusCode="500"/>
    <error statusCode="500" responseMode="ExecuteURL" path="/500.html"/>
</httpErrors>
Run Code Online (Sandbox Code Playgroud)

如果我使用existingResponse="Replace".

但这也拒绝了TrySkipIisCustomErrors那是相当有需要的

我不知道如何修复它。如果我使用替换,它会破坏我的功能,如果我使用自动,那么它不会为 IIS 提供我的自定义页面

任何帮助将不胜感激