I have a dirt simple web service hosted in IIS that I need to reference. If I add a ‘Service Reference’, my app.config gets cluttered up with tons of <system.serviceModel> stuff. If I change the Service Reference to the old style Web Reference, I get the one and only configuration option I actually need in my app.config – the URL of the web service.
Is all the junk that a WCF Service Reference pollutes your app.config with required? Or is there a way to get it to use reasonable defaults and remove all the bindings and endpoints and clutter that was never necessary in the old ASMX web service days. As more and more services are added, this seems like the .config file is going to get unwieldy fast.
Totally agree with you. Pure junk. I use svcutil.exe to generate strongly typed clients to my WCF services. Then I manually include the generated
.csfile into my project and in my web/app.config I manually include what I judge necessary and not what some crappy Add Service Reference Wizard decided to do. In most cases all I need is this on the client side:Of course for services where I use MTOM and some fancy stuff I look at the autogenerated
app.configfile by thesvcutil.execommand and I decide what I need.