How to enable service discovery in IIS?

Damir Dobric Posts

Next talks:



Follow me on Twitter: #ddobric




WCF 4.0 introduces Service Discovery, which I described here. I is interesting that all samples about this feature implements a service in a console application. As you know, service channels in such kind of application are activated explicitly by calling of Host.Open() method. As you also know service channel of the service hosted in IIS is activated when the first message arrives.

This almost unimportant fact might be in some scenarios show stopper. Examples of such scenarios are hosting of relay bindings of .NET Service Bus in IIS and activating of discovery endpoint. Why?

Discovery Feature is used to discover the service for some consumer. This feature is activated when udpDiscoveryEndpoint is activated and that happens when the channel is activated. In IIS context that means, when first message arrives. If consumer of service does not know how to reach the service it cannot send the message. Because no message has arrived, discovery does not work and consumer cannot use discovery client :)

Not bad!?

To make it working enable service auto start in Windows Server AppFabric.


The same can be achieved with following configuration entry:


   . . .
                <add relativeVirtualPath="SampleService.svc" />
. . .

Posted Sep 09 2010, 12:18 AM by Damir Dobric
Filed under:


Luka wrote re: How to enable service discovery in IIS?
on 12-01-2010 14:14

Hello.I was wondering if you knew where to download this:

daenet.dnetfx40Discovery sample

I'm looking for a sample with udp discovery...and maybe a howto guide to actually register this service in appfabric IIS management console.

Thanky ou!

Nadedja wrote re: How to enable service discovery in IIS?
on 12-05-2013 22:59

I agree that most .Net applications are data-driven and Microsoft is the one to blame (for ionrnigg the ORM idea). On the other hand, simple solutions don't require a pure behavioral domain model. They would be just fine with an anemic one. I always have problems judging where is the point where complexity justifies using a full-blown domain model. It is particularly hard when working with a team of developers not familiar with ideas of DDD. Often it is a better idea to stay with transaction script in such cases.And there is one more thing. I consciously put myself in a position where my vote was worth as much as everyone else's because I believe that I have to get acceptance from all involved people (including devs) for my design for the project to succeed. There are, however, situations when democracy is not a good idea. It like in the real life: in the time of peace people enjoy freedom while in the time of war there need to be much more control.UA:F [1.8.7_1070](from 0 votes) is a .Net Community Blog powered by daenet GmbH.