This project is read-only.

Show Detailed ASP.NET Error Messages to Developers (and only to Developers)

Topics: ASP.NET Web API, ASP.NET Web Pages
Feb 25, 2014 at 8:03 AM
Problem: You are developing/maintaining an ASP.NET web-site, and would like the ability to conditionally show/hide runtime error messages depending on who the user visiting the site is.

For a normal user visiting the site you want to be able to display a friendly error message when a runtime error occurs. But when someone within the “developers” security role of your application remotely accesses the site you want to instead show a more detailed exception stack trace error message about the problem without having to change any configuration data.
Please explain me how to use ASP.NET’s role-based security architecture in conjunction with the Global.asax Application_Error event handler to enable this.

Harsh Raj,
Techcronus Business Solutions