【问题标题】:Is there any difference in hosting net.tcp wcf services under Windows 7 and Windows 2008 Server in IIS?在 IIS 中的 Windows 7 和 Windows 2008 Server 下托管 net.tcp wcf 服务有什么区别吗?
【发布时间】:2011-06-20 18:22:36
【问题描述】:

我有一种情况,我无法在 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 完全相同。有任何线索吗?

【问题讨论】:

    标签: wcf iis windows-7 windows-server-2008 nettcpbinding


    【解决方案1】:

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

    结尾
    ... NetTcpPortSharing service: .
    

    不知道从那里去哪里。

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

    我可以通过运行快速修复它

    c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ServiceModelReg.exe -r
    

    【讨论】:

    • 可能是解决方案,我没有那个服务器来验证它了。
    • 那个命令行工具是什么? -r 做什么?您如何发现一个服务指向 3 而另一个指向 4?
    • 啊,我明白了 - 如果您查看服务的文件路径,您会发现一个指向 v3,而另一个指向 v4。我运行了命令并修复了它。谢谢霍特曼!
    【解决方案2】:

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

    【讨论】:

    • 实际上我并没有让它在我的机器上工作,我必须将它部署到测试服务器才能让它工作。
    • 这不是端口共享,因为我配置了它。
    【解决方案3】:

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

    【讨论】:

      猜你喜欢
      • 2015-04-16
      • 2011-08-10
      • 1970-01-01
      • 1970-01-01
      • 2012-06-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多