Problem adding a behaviors element to my WCF client config
- by SteveChadbourne
I'm trying to add a behaviors element to my client config file so I can specify maxItemsInObjectGraph.
The error I get is: The element 'system.serviceModel' has invalid child element 'behaviors'. List of possible elements expected: 'bindings, client, extensions'.
Here is my config:
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_KernService"
maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="ServiceViewEventBehavior">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</endpointBehaviors>
</behaviors>
<client>
<endpoint address="http://localhost/KernMobile.WCF/KernService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_KernService"
contract="KernWcfService.KernService" name="BasicHttpBinding_KernService"
behaviorConfiguration="ServiceViewEventBehavior" />
</client>
</system.serviceModel>
</configuration>
It's also complaining about the behaviorConfiguration attribute in the endpoint element.
Any ideas? .Net 4.0 BTW.