Debugging ADO.NET Data Services
Debugging ADO.NET Data Services can be tricky, not because of the web service part but because of the underlying persistence layer.
You can include the exception details on the error page by including this on the DataService<T> class declaration:
[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
public class MyService: DataService
Next, you must enable verbose errors on the service configuration:
public static void InitializeService(IDataServiceConfiguration config)
{
config.UseVerboseErrors = true;
}
Also, you can override HandleException method:
protected override void HandleException(HandleExceptionArgs args)
{
base.HandleException(args);
}
This method is called first when an exception occurs but before it propagates to the point of crashing.