Seeing the dreaded Request Error page while testing your WCF Web Service?
Well, worry not, because this StackOverflow answer shows you how to turn on detailed error display: WCF Data Service - How To Diagnose Request Error?
But ... hang on, we don't have a Web.Config that looks anything like that one.
Ours just has a system.serviceModel
and that's it.
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"></serviceHostingEnvironment>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true"></standardEndpoint>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
If we go for it and simply add the following:
<behaviors>
<serviceBehaviors>
<behavior name="DataServiceBehavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
on to the end, then boy is it unhappy:
Update/Edit
Based on answers and comments from @burning_LEGION and @Chris (see below) I now have a Web.Config
which looks like this:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"></serviceHostingEnvironment>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" behaviorConfiguration="DataServiceBehavior"></standardEndpoint>
</webHttpEndpoint>
</standardEndpoints>
<behaviors>
<serviceBehaviors>
<behavior name="DataServiceBehavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
But I'm getting a Server Error:
Parser Error Message: Unrecognized attribute 'behaviorConfiguration'. Note that attribute names are case-sensitive.