0

I'm hosting a WCF service inside a windows hosted service.

When I start the WHS, I get the following error:


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

Are these somewhere in Windows or are they registered and unregistered when I start/stop the process?

Matt
  • 25,943
  • 66
  • 198
  • 303
  • Are you trying to host the mex endpoint at the same uri as the service endpoint? – Simon Fox Aug 20 '09 at 00:55
  • Are you absolutely certain that this problem has nothing to do with your configuration? Is that why you didn't post your WCF configuration? Also, that doesn't look like the complete exception. Please post the whole thing. Maybe catch the exception and post the results of ex.ToString(). – John Saunders Aug 20 '09 at 00:59

1 Answers1

2

Use a diffeent endpoint for Mex. It probably needs a different port number from you net.tcp port as well. If your net.tcp port is 8000 then try

<endpoint address="net.tcp://mysecreturl:8001/Mex" 
          contract="IMetadataExchange" />
softveda
  • 10,858
  • 6
  • 42
  • 50