1

I have changed my ASP.NET MVC web.config settings to debug="false":

<system.web>
    <compilation debug="false" targetFramework="4.0">
 .....

but still after deployment to the server, in case of entering wrong URL I get a Server Error page with Exception Details and Stack Trace instead of standard 404 server error page.

What else have I omitted to turn off debug mode?

2 Answers 2

5

You could activate custom errors:

<customErrors mode="On" defaultRedirect="/customerrors/500.aspx">
    <error statusCode="404" redirect="/customerrors/404.html" />
    <error statusCode="403" redirect="/customerrors/403.html" />
</customErrors>
Sign up to request clarification or add additional context in comments.

Comments

1

Turning off debug only removes generation of debug code, it does not change the custom errors mode, which Darin has described how to do. You need to do both for a release build.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.