IIS 7.0 doesn't display custom error pages

前端 未结 4 1321
太阳男子
太阳男子 2021-02-07 18:52

I\'m running an application that has its own error handlers. Error pages are displayed properly while testing in dev environment (error pages are displayed properly).
Howe

4条回答
  •  春和景丽
    2021-02-07 19:48

    Awe is right (+1), but in addition: IIS 7 has special handling described in the blog post you linked and this MSDN article. If you are using HandleErrorAttribute on your action, this is already done for you. If not, you'll need to set:

    filterContext.HttpContext.Response.TrySkipIisCustomErrors = true;
    

    ...yourself.

提交回复
热议问题