restart/iisreset disables NET.TCP protocol?
Asked Answered
S

4

6

I'm hosting a WCF service in IIS7 on Windows Server 08, sp2. The service is hosted as its own website and is exposed via a NET.TCP endpoint. The service works perfectly until a restart/iisreset command is issued.

After restart or iisreset, when I make any service call, I receive the following error: 'System.ServiceModel.EndpointNotFoundException: The message could not be dispatched because the service at the endpoint address 'net.tcp://[website]/[service_name].svc' is unavailable for the protocol of the address.. '

The server's event log shows the following error: 'An error occurred while trying to read and instantiate the configured ProcessHandlerType. Exception: System.ArgumentException Message: Unknown protocol ID 'NET.TCP'. StackTrace: at System.Web.Hosting.ProcessHost.StartProcessProtocolListenerChannel(String protocolId, IListenerChannelCallback listenerChannelCallback) '

Question: How do I fix this? Why is the NET.TCP protocol disabled after iisreset? Is it a bug? Am I missing some configuration?

IIS setup details: - Server 08 and 08 R2 - Bindings: http, NET.TCP (808:*) - EnabledProtols: http,NET.TCP. - The identity for the site's appPool is set to a specific user.

Sample code available here: http://drop.io/wcfTcpSampleService

Thanks

Sou answered 15/6, 2010 at 23:31 Comment(4)
Hacky (unexceptable) Workaround: I can get it working again if (1) I remove NET.TCP from the site's EnabledProtocols (2) iisreset (3) add NET.TCP back to the site's EnabledProtocols. The site continues to work until iisreset is issued again. IIS is doing something when I add NET.TCP to the EnabledProtocols that isn't happening when IIS starts when NET.TCP has already been added.Sou
When this happens, what is the state of the Net.Tcp Listner service? What is the Net.Tcp Listner service startup type set to? Is there anything telling in the System or Application event logs?Gussi
The Net.Tcp Listener Adapter is started (startup type: Auto). The error in the event log is 'An error occurred while trying to read and instantiate the configured ProcessHandlerType. Exception: System.ArgumentException Message: Unknown protocol ID 'NET.TCp'. StackTrace: at System.Web.Hosting.ProcessHost.StartProcessProtocolListenerChannel(String protocolId, IListenerChannelCallback listenerChannelCallback)'Sou
Yes, I meet the same issue. My work around is removing the net.tcp binding from the web site's binding list and adding it back again. Then it works. THIS SUCKS!Malayan
S
9

Solved. The problem is case-sensitivity. In the AdvancedSettings of the web application, the EnabledProtocols field must be lower case ie 'net.tcp' (I just learned this from MS support).

I assumed (foolishly) that 'NET.TCP' should be upper case because of the description of the EnabledProtocols field ("...add those values, such as NET.TCP...").

The strange, unknown issue is why it would work with 'NET.TCP' the first time, but that's another issue.

Thanks for all you help everyone.

Sou answered 29/6, 2010 at 19:46 Comment(3)
Is there any link available from MS support regarding case sensitivity?Prestissimo
@Prestissimo The MS support person only had an internal link describing the case sensitivity.Sou
We're having this issue running Windows Server 2012. Changing the case of net.tcp didn't make a difference. Anyone else?Nemhauser
P
1

Can you use different ports for NET.TCP and HTTP protocols?

Update

On my PC everything works as it should, and I have tried both restart and iisreset. I have uploaded in the same place your project including binaries (used Visual Web Developer 2010 Express), and a screenshot of IIS settings. The app pool is set to .NET 4.0 integrated.

iis7 http://www.freeimagehosting.net/uploads/1a727d66ce.png

Prestissimo answered 28/6, 2010 at 18:1 Comment(3)
I've had this problem using ports 80 and 8008 for http, and 808, 8009, 8089, 9200 for tcp.Sou
@Kevin can you upload somewhere a sample WCF service to play with?Prestissimo
i added a link to a d/l location in the original question.Sou
O
0

Do you actually need to do a full IISRESET? I believe the "modern" recommended method when needing to have a web-hosted app fully restart is recycling the app pool as thus: iisapp /a <App_Pool_ID> /r (Windows 2003) or appcmd recycle apppool /apppool.name:<App_Pool_Name> (Windows 2008).

Oskar answered 25/6, 2010 at 22:59 Comment(1)
Unfortunately, this service is going to be hosted on a machine that many people will have access to and i can't prevent them from doing iisreset. The problem also occurs when the machine is rebooted.Sou
A
0

What versions of .NET do you have (or have you had) installed?

I had a very similar issue when going from .NET 4 RC to RTM as the TCP services were using dlls from the RC install (which no longer existed) causing the services to stop.

Aerobe answered 29/6, 2010 at 2:31 Comment(1)
.NET versions 2.0, 3.0, 3.5. Both the Server 08 and the 08 R2 machines were brand new installs (one VM and one physical machine).Sou

© 2022 - 2024 — McMap. All rights reserved.