If you are already familiar with the WCF Configuration Editor, this post isn't for you. If you have no idea what I am talking about, please keep reading.
Unless you are a masochist or simply possess an exceptional love for angle brackets, the act of creating and modifying xml configuration files isn't exactly fun. Sure, it isn't a big deal to modify an app.config to include a few key-value pairs in the appSettings section. However, if you find yourself deep in the structure of a particular configuration section dealing with some obscure attributes, it can become a real pain. Granted, it became significantly easier to do this sort of thing with the introduction of xml intellisense in Visual Studio 2005, but it got even easier with .NET 3.0 for WCF service configurations.
With the .NET 3.0 SDK, a utility was included to edit WCF configuration files via a GUI. This little utility can be rather handy for people (like me) that don't particularly enjoy modifying deep xml configuration structures by hand. Using the utility, it is possible to modify any aspect of a WCF configuration. Now, there are times when it is overkill to use a GUI to make a simple configuration change. But, it is quite useful for some of the more advanced configuration scenarios.
The utility is accessible from the context menu when you right click on a configuration file from the Solution Explorer in Visual Studio. Simply select the "Edit WCF Configuration" menu option, and away you go.
The easiest way to get a feel for what this utility can do is to play around with it. For a brief example, let's use it to create the custom Http Binary binding I posted about last week.
Right click on the Bindings folder of the Configuration pane and select the context menu option "New Binding Configuration". A dialog window will appear that prompts you to select a binding type. For this example, we are going to create a custom binding. So, select the customBinding option.
This will create a new custom binding pane with the possible configuration options. Notice the Binding Element Extension Position section in the lower right corner of the utility. This is where binding elements can be added, removed, and re-ordered for the custom binding. The utility adds default binding elements httpTransport and textMessageEncoding. Remove the textMessageEncoding and replace it with binaryMessageEncoding. Also, add a reliableSession binding element at the top position. Remember the order is significant since it will dictate the binding element position in the communication stack. Change the name of the binding to NetHttpBinding.
Finally, the applicable service endpoint must be configured to use the custom binding. Expand the services folder. Under the applicable service, expand the endpoint folder. For the http endpoint, set the Binding to customBinding and the BindingConfiguration to NetHttpBinding. This instructs the endpoint to use the previously configuration custom binding.
Note: This example was based on a service and endpoint already being defined in the service configuration. If they do not already exist in the configuration, it will be necessary to create the service and endpoint as well.
Whether this is a useful tool to avoid manually modifying service configurations or simply an unnecessary tool that just slows you down, only you can be the judge. Personally, it is handy to me when dealing with complicated service configurations. But, different strokes for different folks.
Later this week, I will be posting about using the service trace viewer to get a closer look at what is going on with your service. It will touch on the WCF Configuration Editor for the purpose of quickly enabling the diagnostics output.