TimeoutException when WCF Host and Client are in the same process
See the question and my original answer on StackOverflowYou put everything in the same thread. You can't have a client and a server on the same thread, at least not in this kind of code.
If you do this instead, for example:
ThreadPool.QueueUserWorkItem(state =>
{
var clientBinding = new NetTcpBinding();
var testProxy = new TestProxy(clientBinding, new EndpointAddress(baseAddress));
testProxy.Test();
});
your code should work better.
PS: even on the same machine you can have firewall problems - well, that's a feature, not a problem :-).