Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a service in production. There are lots of clients. And I want to host the same service for the new clients using different binding and service behavior.

It seems that WCF runtime doesn't allow to put several service with the same name into the tag. If I'm not mistaken ServiceHostFactory (used by default in IIS activation process) maps the name Service attribute from the svc file to the name attribute of the tag in the web.config to get the binding and binding configuration parameters.

So, If I want to deploy the same service twice but using different service behaviors what should I do?

PS: The only way I can see is to implement the custom ServiceHostFactory.


share|improve this question

migrated from stackoverflow.com Mar 10 '11 at 22:12

This question came from our site for professional and enthusiast programmers.

Can't you just have two separate virtual directories, in which you deploy the same service, but have different web.config with the different settings?? –  marc_s Mar 10 '11 at 19:15
There is a solution: Wrap the current service implementation using a different class that has the same interface and delegates all calls to the inner implementation. Add the new service tag into web.config and put the created class's name as the value of the name attribute. As a result we will hve two services with different service behaviors that share the same implementation. But I'm curious to know the out-of-box solution :) –  Stas Mar 10 '11 at 21:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.