title: WCF Discovery simply doesn't work
body: <p>I'm trying to add ad-hoc discovery to a simple WCF service-client setup (currently implemented by self hosting in a console app). Debugging using VS2010 on windows 7, and doing whatever I can find in online tutorial, but still - the discovery client simply finds nothing. Needless to say if I open a client to the correct service endpoint I can access the service from the client.</p>
  
  <p>service code:</p>
  
  <pre><code>using (var selfHost = new ServiceHost(typeof(Renderer)))
  {
      try
      {
          selfHost.Open();
          ...
          selfHost.Close();
  </code></pre>
  
  <p>service app.config:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;system.serviceModel&gt;
      &lt;services&gt;
        &lt;service name="TestApp.Renderer"&gt;
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="http://localhost:9000" /&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
          &lt;endpoint address="ws" binding="wsHttpBinding" contract="TestApp.IRenderer"/&gt;
          &lt;endpoint kind="udpDiscoveryEndpoint"/&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;serviceDiscovery/&gt;
            &lt;serviceMetadata httpGetEnabled="True"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
    &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>client discovery code:</p>
  
  <pre><code>DiscoveryClient discoveryClient = new DiscoveryClient(new UdpDiscoveryEndpoint());
  var criteria = new FindCriteria(typeof(IRenderer)) { Duration = TimeSpan.FromSeconds(5) };
  var endpoints = discoveryClient.Find(criteria).Endpoints;
  </code></pre>
  
  <p>The 'endpoints' collection always comes out empty. I've tried running the service and client from the debugger, from a command line, from an admin command line - everything, but to no avail (all on the local machine, of course, not to mantion I'll need it running on my entire subnet eventually)</p>
  
  <p>Any help would be appreciated :-)</p>