Using a custom ServiceHost

WCF provides a powerful and flexible configuration system that allows service developers or server administrators to configure service endpoints or hosting behaviors, either programmatically or declaratively (in app.config file). However, sometimes it is useful and important to find a proper means to configure a large amount of services in a common manner instead of manipulating each service individually. In such cases, a quite straightforward way is to create a custom ServiceHost and make all our service hosted with it.

How to do it...

In this recipe, we will use a DebugServiceHost (which ensures that IncludeExceptionDetails is enabled) sample to demonstrate how we can create a custom ServiceHost and use it to extend ...

Get Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.