Навигация

Итоги года

Другие ссылки


Реклама

Счётчики


Getting rid of the "An unexpected error has occurred" message

01.11.2007 Четверг 18:07

While trying to deploy a SharePoint web site to a server I've seen the following error a lot of times:


An unexpected error has occurred.

Troubleshoot issues with Windows SharePoint Services

With no error diagnostics given whatsoever, it makes hard to find what's causing the bugs and fix them. However I've been able to find out how to make SharePoint to become a little more wordy.

For your site find all available web.config files and make sure the following options are set in all of them:

<configuration>
<SharePoint>
<SafeMode MaxControls="200" CallStack="true" AllowPageLevelTrace="true">

...

<system.web>
<customErrors mode="Off" />

<compilation batch="false" debug="true">

Once you do that, you'll start getting the complete ASP.Net diagnostics page instead of the generic error.

Also, when configuring WCF client, make sure to specify includeExceptionDetailInFaults option in the client's configuration file. For example:

<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="BlahBlah.Services.ServiceImplementation.Community_Behavior">
<serviceDebug includeExceptionDetailInFaults="true"/>