Disabling SharePoint errors (An unexpected error has occurred)

One of the most annoying things I came across when I was developing for SharePoint 2007 is the error: “An unexpected error has occurred”. You can get rid of this by disabling the custom errors.

You can do this in two steps:

Step 1: Change

<SafeMode MaxControls="200" CallStack="false" >


<SafeMode MaxControls="200" CallStack="true" >

Step 2:

<customerrors mode="Off" />

If you change these settings in the web.config file you will get the ASP.Net error page with the call stack. You can change this in de web.config file of you web application or you can just edit the default web.config file on you development machine.

You can find your default web.config file in:

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG

Related Posts

SharePoint Rest API Handler SharePoint contains a lot of Rest API’s that can be used for many scenario’s. You could use them for example in desktop and windows phone applications...
User automatically removed from SharePoint Group During my current project we received an access request from a user. We did what we normally do, we checked the request and added the user in the appr...
Warm Up Form Based Web Application Normal warm up scripts for SharePoint open a site object or web object and make a request to that specific site. When you use form based authenticatio...
Unable to start User Profile Synchronization Service A few days ago I wrote a post about loading modules in PowerShell by default: “Load modules by default when opening PowerShell”. Today we had to setup...
Load modules by default when opening PowerShell At the moment we are working a lot with PowerShell in combination with SharePoint. Over time we created a lot of usable functions that were not availi...
PowerShell Scripts During my current project we are using a lot of PowerShell scripts to administrate the environment and make development easier for us. In this post...

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.