ServiceReference.ClientConfig is not populated with Service Reference
March 24, 2011
Posted by on
I came across a strange behavior of Visual Studio. When I made a Service reference in my Silverlight application, the visual studio created the classes and schemas; but not the config file (ServiceReference.ClientConfig)
The reasons for having ServiceReference.ClientConfig not populated could be many. But in my case, I was using wsDualHttpBinding in the service (a duplex channeled service).
wsDualHttpBinding and may other bindings are not supported by Silverlight. To be precise Silverlight supports only BasicHttpBinding, pollingDuplexHttpBinding (supported with Silverlight 4) and customBinding.
When I made some changes in the service and changed the binding as basicHttpBinding, the Service Reference update populated the ServiceReference.ClientConfig file.
It could have been better if the service reference threw exception saying that the Silverlight supports only a subset of WCF bindings, instead of completing the reference successfully leaving the Config file incomplete. Hopefully the future releases of Visual studio would do that.
The following forum helped me narrow the issue.
Failed to generate the service reference WCF service