net.tcp service is unavailable for the protocol of the address
Asked Answered
G

1

14

Our application is hosted in IIS 7.0. It exposes endpoints over net.tcp protocol. But we kept running into the following exception:

EndpointNotFoundException: The message could not be dispatched because the service at the endpoint address 'net.tcp://localhost/xxx/service.svc' is unavailable for the protocol of the address.

We have checked the following places for possible causes.

  • Windows Process Activation Service is running OK
  • Net.Tcp Listener Adapter service is OK.
  • Net.Tcp Port Sharing service is OK.
  • We made net.tcp binding for the web application.
  • The net.tcp protocol is enabled for the web application as below. net.tcp protocol is enabled

I have tried to reset the IIS after checking all the above places. Still not working.

This is killing me. Hope someone could give me some hints.

I have searched a lot. Seems this is a very common issue which hasn't be perfectly solved. I think it's time to end this pain in ass.

Many thanks!

Grafton answered 31/8, 2011 at 9:5 Comment(0)
H
5

It is hard to say but on what port are you trying to connect?

Make sure that port is available and nothing else is using it.

If you are using a proxy you should add the below as well:

......
 <httpTransport
      maxBufferPoolSize="4194304"
      maxBufferSize="1048576"
      maxReceivedMessageSize="1048576"
      proxyAddress="http://127.0.0.1.:8888
      useDefaultWebProxy="false"
    />
  </binding>
</customBinding>
Humerus answered 31/8, 2011 at 9:10 Comment(4)
Based on the exception message, it seems the net.tcp protocol is not functioning. But thanks, I will check the port number in my firewall.Grafton
I re-read your answer. And yes, there's another web site's binding is using the same net.tcp port. But strange enough, the site is stopped, and also the app_pool is stopped. This is very different from the HTTP experience, where I can share 80 port among multiple web sites as long as only one is online. After I remove the other net.tcp binding or changed it to a different port. And then reset the IIS. The troubled service is OK. And note that the IIS must be reset.Grafton
I am curious about why HTTP and net.tcp protocols behave so differently. Is it because HTTP protocol is controlled by IIS, while net.tcp is not (I am not sure who controls it, maybe the Windows Process Activation Service). And the 2 protocols are controlled differently.Grafton
I hope other people could further confirm this and I will mark your answer soon since you remind me of the other web site using the same net.tcp port.Grafton

© 2022 - 2024 — McMap. All rights reserved.