Tip/Trick: Show Detailed ASP.NET Error Messages to Developers (and only to Developers)

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 like this 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: The below post describes how to use ASP.NET’s role-based security architecture in conjunction with the Global.asax Application_Error event handlerto enable this. You can also...(read more)

RSS feed for comments on this post · TrackBack URL

Leave a Comment

You must be logged in to post a comment.