[RESOLVED]How to make custom ErrorPages in MVC5

Edit: Never mind, helps to being the right project of the solution when doing this.

I would like to serve up a customer 404 and 500 error page and tried following
http://benfoster.io/blog/aspnet-mvc-custom-error-pages but I still get the default error pages when I test them out in VS debugger. What do I have to do to get this working?

            <remove statusCode="404" />
            <error statusCode="404" path="404.html" responseMode="File" />
            <remove statusCode="500" />
            <error statusCode="500" path="500.html" responseMode="File" />

        <compilation debug="true" targetFramework="4.5.1" />
        <customErrors mode="On" redirectMode="ResponseRewrite">
            <error statusCode="404" redirect="~/404.aspx" />
            <error statusCode="500" redirect="~/500.aspx" />
        <httpRuntime targetFramework="4.5.1" />

I have managed to write up a small article on this.Hope this could help you.



Leave a Reply