How do I enable a custom error page in my development environment?

Bryan Drenner asked on October 2, 2014 21:58

I followed the instructions on this page to enable a custom error page. However I am still seeing the YSOD.

My Web.config has the following elements, which I added according to the documentation:

<system.webServer>
    ...
    <httpErrors existingResponse="Auto" errorMode="Custom">
      <clear />
      <error statusCode="500" path="/ErrorPage.aspx" responseMode="ExecuteURL" />
    </httpErrors>
    ...
</system.webServer>

It also has these elements, which I haven't touched:

<system.web>
    ...
    <customErrors defaultRedirect="~/CMSMessages/error.aspx" mode="Off">
        <error statusCode="404" redirect="~/CMSMessages/PageNotFound.aspx" />
    </customErrors>
    ...
</system.web>

My understanding is that customErrors is a legacy element, and that httpErrors should work for IIS7 and later. I'm using the latest IIS Express. So why isn't this working?

Recent Answers


Bryan Drenner answered on October 2, 2014 22:07

If I set customErrors to this, then my error page works. I wonder why httpErrors does not work. This is probably an ASP.NET question and not a Kentico-specific question, except that Kentico's documentation says httpErrors should work for IIS7+.

<customErrors defaultRedirect="~/ErrorPage.aspx?" mode="On" />
0 votesVote for this answer Mark as a Correct answer

Martin Danko answered on October 13, 2014 16:59

Hello Bryan,

not sure, if you have checked the Documentation: Creating custom error handling pages but one difference here could be that you are using IIS Express.

Best regards, Martin

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.