Today I started a new WCF Data Services project, set my data context (well actually I didn’t as we’ll see in a moment), hit F5 and I was greeted with a very unhelpful error message: The server encountered an error processing the request. See server logs for more details (see image below).
I had no idea where these server logs are, and in fact I still don’t. Searching around led to several people with the same problem, but different causes:
- Incorrect correction string, usually from a minor typo
- Typo in one of the strings in the IntializeServiceMethod
Thankfully you can get some type of an error message displayed if you add the following class level attribute to your Data Service class:
[System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
I then came across this stack overflow question which explains how to enable the server logs talked about in the original error message. They are in fact svclog files, which can be viewed using SvcTraceViewer. If I am remembering correctly, these would be the same log files that are created with WCF services, which makes sense.