Disabling SharePoint errors (An unexpected error has occurred)

less than 1 minute read

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" >

to

<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