我正在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中的某个位置,还是在我启动/停止进程时注册和取消注册?
答案 0 :(得分:2)
为Mex使用不同的端点。它可能需要与net.tcp端口不同的端口号。如果你的net.tcp端口是8000,那么试试
<endpoint address="net.tcp://mysecreturl:8001/Mex"
contract="IMetadataExchange" />