Okay, I'll try to make this as straight forward as possible. I'm using VB.Net in VS2010, I'm attempting to self-host a WCF service. (It's actually in a windows service, but I'm trying to do this via a simple console app. Below is the code in question, the TCP/IP addresses are injected directly here. The WCF service itself is simply a renamed DEFAULT new WCF service project.
Dim host As New ServiceHost(GetType(TestService))
Dim tcpb As New NetTcpBinding()
tcpb.PortSharingEnabled = True
host.AddServiceEndpoint( _
GetType(ITestService), _
tcpb, _
"net.tcp://localhost:62020/TestWcfService/" _
)
host.Open()
Console.ReadKey(True)
host.Close()
I don't think I can make this much simpler.. is there something special I need to do to get the port to actually bind? when I run netstat -a
it doesn't show a listening port on 62020 I am really at my whits end on this.
Background: I have another WCF service I'm trying to migrate out of IIS, and into a separate server running in a Windows Service. The WCF service will only be accessed internally. I've been having numerous issues in getting that migrated, so trying to get a simple service to bind, and have a client (website) access it. The other WCF is binding (different port) fine, but having communications errors. There is a literal **-ton of stuff out there, and very little really fits my needs, and I'm having a lot of trouble getting anything working with it.