Home > Uncategorized > Don’t you love the real ASP.Net exception page?

Don’t you love the real ASP.Net exception page?

January 16th, 2007 Leave a comment Go to comments

Tired of seeing custom/friendly exception descriptions (such as “An unexpeted error has occured”) in your sharepoint sites specially when you are developing master pages or web parts? why not trying this:


1) Locate the web.config of your site.


2) Find <SafeMode> element and enable the CallStack attribute by changing CallStack=”false” to CallStack=”true”. This ensures that the call stack and an exception message is shown when a system-level exception occurs. You can optionally change AllowPageLevelTrace=”false” to AllowPageLevelTrace=”true” for more monitoring features.


Warning: Setting the CallStack attribute to true enables this functionality for all local and *remote* clients. At this point there is no way to differentiate between these two scopes, so think twice about the information disclosure while setting this attribute.



3) Find <customErrors> and change it to  <customErrors mode=”Off” />or


Warning: Setting the mode attribute to “On” enables this functionality for all local and *remote* clients.”RemoteOnly” Specifies that custom errors are shown  only to the remote clients, and that ASP.NET generic errors to the local clients.RemoteOnly mode is usually combined with defaultRedirect attribute in 
production enviroment to redirect the user to a custom generic error page such as defaultRedirect=”GenericError.htm”.


<customErrors defaultRedirect=”GenericError.htm” mode=”RemoteOnly”>
 <error statusCode=”500″ redirect=”InternalError.htm”/>
</customErrors>


4) Find compilation element and change it to <compilation batch=”false” debug=”true”> to have the .Net framework produce debug binaries rather than release (retail) binaries. Make sure you turn this off when you go live in production.


5)IISRESET or “%systemroot%sytem32IISAPP.vbs /a AppPoolNameUnderwhichSiteIsRunning  /r”



Categories: Uncategorized Tags:
  1. No comments yet.
You must be logged in to post a comment.