Monday, August 29, 2011

The server was unable to process the request due to an internal error

If you are hosting any wcf service in the production and you are getting the below error, rather getting the exact exception then you need to do as described below. The error message is:
{"The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs."}

For this you need to change in the App.config file in the wcf project. Put the below tag in the  <serviceBehaviors> section.
<serviceDebug includeExceptionDetailInFaults="True" />

Now you will able to see the exact internal error message.
 But it is highly advisable to do includeExceptionDetailInFaults="False"  in the production environment. This is helpful for debugging an wcf application.

No comments:

Post a Comment