2

I'm using MVC2.
My webconfig says

<customErrors mode="On" redirectMode="ResponseRewrite" defaultRedirect="~/internal-server-error"> <error statusCode="500" redirect="~/internal-server-error" /> <error statusCode="404" redirect="~/not-found" /> </customErrors> 

My test method says

public ActionResult ErrorTest() { var z = 0; var x= 3/z; return null; } 

I still get the default Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed., instead of my custom error method, which is not even called.

Why? Is this a dev server issue? Will it work on IIS?

EDIT: Tried it on IIS Express as well, commented out the whole Application_Error in Global.asax.cs, still not working.

1 Answer 1

3

Try removing redirectMode="ResponseRewrite" attribute

CustomErrors does not work when setting redirectMode="ResponseRewrite"

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.