Problem running the WCF 4 DiscoveryProxy sample

Today I was playing around with managed WS-discovery with WCF 4. To try a couple of things I used the WCF sample DiscoveryProxy.

However running the sample gave me this error:

{"A TCP error (10013: An attempt was made to access a socket in a way forbidden by its access permissions) occurred while listening on IP Endpoint=0.0.0.0:8001."}

The solution is simple: The probing endpoint address was using a socket used by another application. So to make the sample work I changed the port number in the endpoint:

Uri probeEndpointAddress = new Uri("net.tcp://localhost:8020/Probe");

That fixed the problem. Don’t forget to update the client as well, because it also uses this endpoint.