Errors are common on any application. With ASP Applications it is hard to tell what caused an error, since default errors are not specific enough and won’t tell you what went wrong. In this article I will show you on a step-by-step guide how to display detailed errors in ASP.net applications
1. Open the web.config of your application.
2. In the web.config file, look for the <system.web> section. Inside this section we will use the <customErrors> tag. This tag offers three modes which are:
This mode is responsible for displaying error message on local and remote server in case of an error.
This mode is responsible for displaying custom error page with message on local and remote server in case of an error. By using this mode, we can show our own custom error messages page for specific errors on local and remote server.
This mode is responsible for displaying error message on remote server only in case of an error. By using this mode, we can show our own custom error messages page for specific errors on remote server only.
In this case, we will use the off setting to get detailed errors:
<customErrors mode “off”></customErrors>
3. Save the changes and update your ASP Application.
4. That’s it, now you will get a detailed error page:
It is very important to have this setting, because if you ever get an error in your application, you won’t spend time finding out what caused the error.
This concludes Display detailed errors in ASP.net apps.