user514005
user514005

Reputation:

WCF - The message could not be dispatched because the service at the endpoint address ... is unavailable for the protocol of the address

Ok, can I vent?? I am so sick and tired of this. I'm working away most of the day and the WCF services are working great. Next time I run my app and make a WCF call, bam! the tcp socket is no longer available. I have searched high and low to solve this and there is no real solution. The only solution I can find is to reboot the machine which is a huge time-waste and burden. Restarting WPA service, net.tcp service, IIS, etc. does not do a thing. Logging off and back on does not fix it. Only a reboot fixes this issue. I do nothing except run my app again making a WCF call, and this crap happens. There are no configuration issues with anything. I have been dealing with this for months and cannot find any specific reason or solution as to why this happens. It happens with my firewall on or off, does not matter.

Any insight from anyone? I think there is truly a bug in the WCF / net.tcp layer that is causing this. I even get it on a production 2008 R2 server when sometimes making a Web.config change, so I have learned to stop the IIS, WPA, net.tcp, etc. services prior to the change then restart them. What a pain.

I'm using .NET4 all around, VS2010, all service packs, etc. applied. Everything is the most current.

Excuse me while I reboot.....

Can anyone help with this?

Upvotes: 27

Views: 27704

Answers (5)

dksh
dksh

Reputation: 194

I had this issue. It would happen after each IIS reset (which happens as part of our deployment). The issue was resolved after restarting NetTcpPortSharing service (which also restarts Net.Tcp Listener Adapter service)

Upvotes: 4

Serge
Serge

Reputation: 6712

  1. Open a command prompt
  2. Navigate to c:\windows\microsoft.net\framework64\v4.0.30319
  3. Register the service model using the command "ServiceModelReg.exe -r"

Credits go there http://kumaranbose.blogspot.be/2010/08/cryptic-wcf-nettcp-errors.html

Upvotes: 24

Vlad Lyandres
Vlad Lyandres

Reputation: 79

This issue hunts me for almost 3 years now but only happens sporadically. TCPView helped. I have killed SMSSvcHost.exe process and then restarted Net.Tcp Listener Adapter service. That cleared the issue. Not really a solution but at least, I don't have to resort to rebooting the server anymore.

Upvotes: 8

Rustin
Rustin

Reputation: 89

Sounds Net.Tcp Listener Adapter service is being killed by some process or exception being throw by the web service putting the channel in a faulted state.

Have you tried setting the startup type of the service to automatic and recovery to restart service on first and second failure?

I doubt it very much that there is a bug in wcf net.tcp channel layer. If the listener is running and tcp socket no longer available i would suggest you look into the code especially around the exception handling strategy and have a peek into the iis request logs.

Upvotes: 0

Petar Vučetin
Petar Vučetin

Reputation: 3615

I am not sure I have an answer but, you could identify the process that has the port open and that can help narrow the scope of the problem. I have used Sysinternals suite which has a TCPView. This proggy was helpful to me.

TCPView - http://technet.microsoft.com/en-us/sysinternals/bb897437

Upvotes: 1

Related Questions