Why can't I connect to a WCF service with net.tcp but i can with http?

If you are using Vista, then ensure the WAS and Net.Tcp Listener Adapter Services are running.


For anyone that stumbles accross this, my guide to trouble-shooting net.tcp WCF issues like this:

  1. Check that net.tcp is an enabled protocol for the web site (in IIS, right-click the site, goto advanced settings, and ensure that Enabled Protocols includes "net.tcp"
  2. I'm not sure if this is a paranoia thing, I also have always needed to enable net.tcp for the Site via the command line as well as step 1. Open a command prompt, and from c:\windows\system32\inetsrv, enter appcmd.exe set app "NameOfWebsite/" /enabledProtocols:http,net.tcp
  3. Check that the bindings for the website in IIS have an entry for net.tcp, and that you've bound it to the correct port number (for me, I use 9000:* as my binding to port 9000). Also check that no other websites in IIS are using the same net.tcp binding to that port
  4. Check that the "Net.TCP Listener Adapter" service is running.

Done.


Check out this post on enabling non-HTTP bindings in IIS 7.0. By default, you have to explicitly enable net.tcp in IIS 7.0.

Hope this helps.

UPDATE:

Saw your comment - unfortunately, net.tcp is not supported in IIS 6.0. Check out this link which details the supported WCF bindings for various hosts (including self-hosting, WAS, and IIS). Looks like only HTTP bindings work in IIS 6.0.

Tags:

Wcf

Iis 6

Tcp