【问题标题】:Hosting a WCF(mex endpoint) service inside a windows service on windows 2008在 Windows 2008 上的 Windows 服务中托管 WCF(mex 端点)服务
【发布时间】:2009-08-20 00:51:21
【问题描述】:

我在 Windows 托管服务中托管 WCF 服务。

当我启动 WHS 时,我收到以下错误:


The ChannelDispatcher at 'net.tcp://mysecreturl/' with contract(s) '"IClass"' is unable to open its IChannelListener.

System.InvalidOperationException: A registration already exists for URI 'net.tcp://mysecreturl/Indexer/'.
   at System.ServiceModel.Channels.UriPrefixTable`1.RegisterUri(Uri uri, HostNameComparisonMode hostNameComparisonMode, TItem item)
   at System.ServiceModel.Channels.ConnectionOrientedTransportManager`1.Register(TransportChannelListener channelListener)
   at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
   at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
   at System.ServiceModel.Channels.ConnectionOrientedTransportChannelListener.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.TcpChannelListener`2.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)

   at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at VBoD.Search.WindowsServiceHost.WindowsServiceHost.OnStart(String[] args) in D:\......:line 29

System.ServiceModel

这些是在 Windows 中的某个地方,还是在我启动/停止进程时它们已注册和未注册?

【问题讨论】:

  • 您是否尝试在与服务端点相同的 uri 中托管 mex 端点?
  • 您确定这个问题与您的配置无关吗?这就是您没有发布 WCF 配置的原因吗?此外,这看起来并不完全是例外。请张贴整个事情。也许捕获异常并发布 ex.ToString() 的结果。

标签: .net windows-services windows-server-2008 wcf


【解决方案1】:

为 Mex 使用不同的端点。它可能还需要与您的 net.tcp 端口不同的端口号。如果你的 net.tcp 端口是 8000 那么试试

<endpoint address="net.tcp://mysecreturl:8001/Mex" 
          contract="IMetadataExchange" />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-13
    • 2013-08-06
    • 2012-04-28
    相关资源
    最近更新 更多