• Grumpy Wookie

    View Chris OConnor's profile on LinkedIn

  • Archives

  • Top Posts

  • Flickr Photos

    4780_113082538658_784073658_2905444_7437417_n

    4780_113082533658_784073658_2905443_6843979_n

    4780_113082528658_784073658_2905442_8369531_n

    4780_113082523658_784073658_2905441_776992_n

    4780_113082518658_784073658_2905440_3601069_n

    4780_113082513658_784073658_2905439_2663807_n

    More Photos
  • Recent Visitors

  • Blog Stats

    • 186,883 hits

An unexpected error has occurred

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

image

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

image

  • And…

<customErrors mode=”Off” />

image

  • 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 !”

image


On the topic of Master Pages, and SharePoint Publishing sites, Heather Solomon has a number of awesome resources for SharePoint “publishing” :

3 Responses

  1. 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.

  2. I tried all of the steps but still can’t seem to get it to produce a useful error. /sigh

Leave a Reply