5

我有一种情况,我无法在 Windows 7 下使用 net.tcp 托管服务,但它在 Windows 2008 服务器上运行良好。我启用了 WAS,并在 Windows 7 和 Windows Server 中进行了相同的设置,但由于某种原因它在 Windows 7 中不起作用。我在客户端遇到的错误是:

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()

在事件日志中,我收到以下服务错误:

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

Windows 7 和 Windows 2008 上的服务的 web.config 完全相同。有任何线索吗?

4

3 回答 3

9

我遇到了同样的问题,其中异常消息以

... NetTcpPortSharing service: .

这不知道从那里去哪里。

原来,Net.Tcp Listener Adapter 服务指向 .NET 3,而 Net.TCP 端口共享服务指向 .NET 4

我能够通过运行快速修复它

c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ServiceModelReg.exe -r
于 2011-10-14T14:31:56.083 回答
0

我想你已经解决了它......是不是没有启用端口共享的情况? http://msdn.microsoft.com/en-us/library/aa395195.aspx

于 2011-04-08T20:26:30.357 回答
0

似乎它正在工作。我现在有一台新电脑,又试了一次,完全没有问题。因此,使用 IIS7 在 Win 7 上托管 net.tcp 应该可以正常工作。

于 2011-06-17T14:22:34.910 回答