Set Web.config to Show Error Messages

In ASP.NET web application development it is common practice to deploy to staging server before deploying it to production environment. Sometimes it is useful to show errors on staging environment and even production environment, especially after realizing that there is no errors on development environment. Most errors could be related to enviroment such as not being able to connect to database, IIS security issue, etc.

Here is how to add or change Web.config of the deployed application on staging server. Use Notepad or Notepad++ to open root Web.config, find or add the following xml tags:

To disable or hide error messages again, you can simply comment it out like below:


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.