Search
More About This Website

All information is provided "AS IS" with no warranties, and confers no rights

Login
« Silverlight MeasureOverride Watch Your Size | Main | Adding Target to ASP.NET Menu Control »
Friday
Nov212008

ADO.NET Data Services - The server encountered an error

One of the more common errors I have seen when setting up a new ADO.NET Data Service endpoint is the following error

The server encountered an error processing the request. See server logs for more details.

What I have found is the most frequent cause of this is a typo in the Initialize method.  For example if you try to configure access to an entity named Product when the real entity name is Products. 

config.SetEntitySetAccessRule("Product", EntitySetRights.AllRead);

instead of

config.SetEntitySetAccessRule("Products", EntitySetRights.AllRead);

Yes, even one letter off can do it, and the worse part is it’s so easy to overlook.

I recommend if you get this error try to slim down your Initialize method as much as you can to find the line that is causing the error. 

If you get past the initial setup another good property that you can enable is the UseVerboseErrors.  This property won’t help you with problems in your initialize, but can provide good data later when you get errors using the service.  Turning it on is as easy as the following example :

config.UseVerboseErrors = true;

Reader Comments (1)

Very helpful, thanks!

August 21, 2009 | Unregistered CommenterJames

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>