What’s new in WCF 4.5 – generated client config cleaned
One of our primary focuses this release was to simplify working with WCF. Configuration simplicity was right at the top since we know most of you find configuration hard and confusing.
We will talk about the configuration improvements in separate detailed posts but I wanted to highlight couple of small improvements in 4.5.
1) Reduced the mammoth client side generated config to only non-default values:
Well, if you are a WCF user, you would have definitely used the “Add Service Reference” (ASR) functionality or used svcutil.exe to point to a service WSDL to generate a service reference and associated configuration required to call the service. I bet, you would have also noticed the huge configuration file where we used to dump all the binding properties and trust me, WCF has quite a few of these
To remind you of the ugly sight which present you – here is what you get today with Visual Studio 2010 when you generate a service reference for a simple WCF service with a single endpoint and basicHttpBinding:
In Visual Studio 2011, we have fixed this and when you generate a service reference – you will get much neater and cleaner config file which we hope, you will find much simpler:
Notice that the entire binding section has been trimmed down. We will only generate non-default values here so say for e.g. I changed the message encoding on the service to “Mtom” and I regenerate the service reference on the client – I will get the following. Notice that we have generated only the non-default value of messageEncoding here.
While on the topic of discovering little gems around configuration – here is another one.
2) Made the WCF config editor easily discoverable
This was one of my pet peeves. I really like the Configuration editor tool even though it is not as powerful as it could be. Even in its current form, it allows me to make configuration changes easily without requiring me to remember every config property WCF has to offer by its name and location. We have shipped this tool in the previous releases and yet, very few folks actually know about it let alone use it. And one of the key reasons was that we used to hide it somewhere in the tools menu where very few folks poke around. Once you have opened the configuration file via this tool, a right click context menu item belatedly used to appear for the configuration file to allow easy access thereafter. But – good luck finding it the first time!
Now it is available as a right click gesture right there on the config file from the time you open up a new WCF project as “WCF Service application” or “WCF Service library” templates. So hopefully, you can find it and use it more often!
Thank you!
Comments
- Anonymous
October 04, 2011
Nice to see the WCF config changes. I remember providing feedback on this almost a year ago. :) Do you know if the WIF bindings generated config have changed at all too? Thanks,