Loading WCF Client Configuration from Different Files with ConfigurationChannelFactory

One pain point with configuration that WCF developers have run into in previous versions of the framework is the limitation that WCF clients can only use the hosting executable’s configuration file. This can be problematic for clients that need to call multiple services because the configuration for all of these services would have to be…

5

How to Change .NET Configuration Files at Runtime (including for WCF)

One of the most common issues people run into with WCF configuration, and .NET applications in general, is that configuration files appear to be fixed. You only have one configuration file for an executable, and you can’t use different configuration files as your exe.config while the application is running. Of course, you can always shut…

5

Behavior Merge in WCF 4.0 Configuration

One of the brand new configuration features you can find in the Beta 2 release of .NET 4.0 is the ability to merge behaviors in the configuration hierarchy. This should make it easier to manage behaviors when you want a set of common behaviors to be used consistently. To illustrate how this works, let’s say…

4

Separating out WCF Configuration Into Multiple Files with configSource

WCF configuration files can sometimes be very, very long. And there’s a good reason for that too: WCF makes heavy use of configuration so that you can do just about anything you can do with code in a config file. I recently decided to estimate how much of the entire framework’s configuration belongs to WCF…

1

WCF 101: The Simplest WCF Example You’ll Ever See

Every once in a while, I’ll encounter a developer that thinks that WCF is too complicated to use. Whereas in fact, the basics of WCF are incredibly simple. MSDN’s tutorial hides this fact by making their introduction to WCF a fairly long and painful 6-step process, but you need much less to write your first…

7

Beta 2’s out!

Ok, so a bit late, but the Beta 2 release of Visual Studio 2010 was released two weeks ago. With Beta 2 come a number of changes to the DataContractResolver, so I’ve finally found the time to update my previous post. For those that have read the post during Beta 1, ResolveType has become TryResolveType…

0

Serializing Plain Old CLR Object (POCO) types with DataContractSerializer

When version 3.0 of the .NET framework shipped, DataContractSerializer could only support a few categories of CLR types. Sowmy has a good list of these that you can find here. The recommended model was to use DataContractAttributes on classes and structs along with DataMemberAttributes on fields and properties to customize the serialization of types. I…

0

Optimizing Away Repeat XML Namespace Declarations with DataContractSerializer

For performance reasons, DataContractSerializer can’t always figure out what namespaces will be used in a serialized instance ahead of time. And so, you may sometimes end up having a certain XML namespace defined over and over again when it only has to be declared once. This can be particularly painful because XML namespaces tend to…

7