Where and how to define for my asp.net MVC 3 web application

From my experience, we should turn custom error to On in release mode and turn it off in debug. To automatically do this, we can use web.config transformation like the following example.


This setting will allow web server to display ASP.NET yellow page that contain useful error information.

<customErrors mode="Off" xdt:Transform="Replace" />


In the other hand, we don’t want user to know technical error. We should use custom error page instead of ASP.NET yellow page.

<customErrors mode="On" xdt:Transform="Replace" />

Leave a Comment