Is there any difference in hosting net.tcp wcf services under Windows 7 and Windows 2008 Server in IIS?
Asked Answered
R

3

5

I have a situation where I can't host a service using net.tcp under windows 7 but it works fine on windows 2008 server. I have enabled WAS, and made the same settings in both windows 7 and windows server but for some reason it doesn't work in windows 7. The error I get on the client side is:

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

Server stack trace: 
   at System.ServiceModel.Channels.ConnectionUpgradeHelper.DecodeFramingFault(ClientFramingDecoder decoder, IConnection connection, Uri via, String contentType, TimeoutHelper& timeoutHelper)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
   at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open()

And in the event log I got the following error for the service:

An error occurred while trying to listen for the URL '/LM/W3SVC/9/ROOT/TcpTest'. This worker process will be terminated.
 Sender Information: net.tcp
 Exception: System.ServiceModel.WasHosting.TcpAppDomainProtocolHandler/24230272
 Process Name: System.ServiceModel.CommunicationException: The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: .
   at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Register()
   at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Open(Boolean isReconnecting)
   at System.ServiceModel.Channels.SharedConnectionListener.StartListen(Boolean isReconnecting)
   at System.ServiceModel.Channels.SharedTcpTransportManager.OnOpenInternal(Int32 queueId, Guid token)
   at System.ServiceModel.Activation.HostedTcpTransportManager.Start(Int32 queueId, Guid token, Action messageReceivedCallback)
   at System.ServiceModel.WasHosting.TcpAppDomainProtocolHandler.OnStart()
   at System.ServiceModel.WasHosting.BaseAppDomainProtocolHandler.StartListenerChannel(IListenerChannelCallback listenerChannelCallback)
 Process ID: w3wp

The web.config is exactly the same for the service on both windows 7 and windows 2008. Any clues?

Representational answered 3/2, 2011 at 15:39 Comment(0)
R
0

It seems like it is working. I have a new computer now and tried it again with not problem at all. So it should work just fine to host net.tcp on Win 7 with IIS7.

Representational answered 17/6, 2011 at 14:22 Comment(0)
D
9

I was having this same problem, in which the exception message ends in

... NetTcpPortSharing service: .

which gives no clue where to go from there.

It turned out that the Net.Tcp Listener Adapter service was pointing to .NET 3 and the Net.TCP Port Sharing Service was pointing to .NET 4

I was able to quickly fix it by running

c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ServiceModelReg.exe -r
Demilune answered 14/10, 2011 at 14:31 Comment(3)
Might be the solution, I don't have that server anymore to verify it.Representational
what is that command line tool? what does -r do? How did you find that one service was pointing to 3 and the other to 4?Hodess
Ahh I see - if you look at the file path of the services you can see one is pointing to v3 while the other is v4. I ran the command and it fixed it. Thanks hortman!Hodess
Z
0

I guess you've already solved it since... Was it the case with portsharing was not enabled ? http://msdn.microsoft.com/en-us/library/aa395195.aspx

Zorazorah answered 8/4, 2011 at 20:26 Comment(2)
Actually I didn't get it to work on my machine, I had to deploy it to the test server to get it to work.Representational
and it wasn't port sharing, since I configured that.Representational
R
0

It seems like it is working. I have a new computer now and tried it again with not problem at all. So it should work just fine to host net.tcp on Win 7 with IIS7.

Representational answered 17/6, 2011 at 14:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.