I am specifying maxItemsInObjectGraph in the server config file but while creating client config file, this attribute is ignored and i have to manually add it in the endpointBehaviors section.
Is there a way i can make some changes in the config file so that everytime i generate client config and proxy via Svcutil.exe, this behaviour is automatically included in the client config file?
i tried ading [ServiceBehavior(MaxItemsInObjectGraph = 2147483647)] to the service interface but it gives me an error saying Attribute 'ServiceBehavior' is not valid on this declaration type. It is only valid on 'class' declarations.
No, that is another behavior which is configured per participant. Each client has control over this property and service doesn’t expose this property because it could be considered as security issue.
If your problem is mainly about development (where you don’t want to modify your behavior every time you refresh the reference) you can use
commonBehaviorssection which can be defined only in machine.config:Common behaviors are added to every service / endpoint running on the machine. It is perhaps good for development but you mustn’t forget that once you will prepare package for production you will have to add this configuration to production’s config file – because of that it is better to maintain such configuration file continuously and use it on some build / test server.