This message is the biggest pain-in-the-butt for SharePoint developers – I’m sure you’ve seen it on more than one occasion.
Thanks for nothing SharePoint !!
Working out WHAT error has occurred can be annoying and frustrating !!
Bear in mind that SharePoint itself is (to overly simplify matters) – just an ASP.NET web application, complete with ASPX pages, ASCX controls, and web.config files – and a big, scary SQL Server database behind the scenes.
It follows that you can use the same debugging methods when dealing with SharePoint – as for any other ASP.NET application.
The scenario I’m having problems with (in this example) is that a master page for a content publishing site is misbehaving, and giving me the “unexpected error”.
When using other master pages, there is no error – but “my” master page causes a problem.
There’s nothing listed in the Event Viewer – nothing relating to the specific site or page/s.
So – here’s the trick :
- Find the web.config for the specific SharePoint site
- The default location is as follows – with one folder per “port” :
C:\Inetpub\wwwroot\wss\VirtualDirectories
- Open the web.config file – using Visual Studio or Notepad
- Change the following settings
<SafeMode CallStack=”true“>
- And…
<customErrors mode=”Off” />
- Close and save the file
- IMPORTANT – do an IISRESET, to reload the updated settings
- Refresh/re-load the page (CTRL-F5)
- You should get a more helpful ASP.NET stack trace.
In my case, I’d broken the master page by removing a content placeholder – or, as the MythBusters would say – “well THERE’s your problem !”
On the topic of Master Pages, and SharePoint Publishing sites, Heather Solomon has a number of awesome resources for SharePoint “publishing” :
- Heather Solomon’s Minimal or Base Master Pages
- Branding SharePoint (Part1, Part2, Part3)
- CSS Reference Chart
- Lots of other articles can be found here.
Filed under: SharePoint















We are using PPS, WSS 3.0 and PAS. We have created a dashboard that integrates with PAS.
We can preview dashboard from our workstations successfully.
We can remote to server where PPS and WSS 3.0 are located and pull up dashboard on our Sharepoint Site that we deployed the Dashboard too successfully.
We try to click on on deployed dashboard from our workstations and we receive;
Gas Production (PAS)
An unexpected error occurred
Any help is greatly appreciated.
I tried all of the steps but still can’t seem to get it to produce a useful error. /sigh
Opps, your fix did work! Sorry, it was user error on my end.
Thanks!