locked
Clustered service host - registration already exists for URI RRS feed

  • Question

  • User-326655346 posted

    I have a WCF application that is encountering the following error:

    ************** Exception Text **************
    System.InvalidOperationException: The ChannelDispatcher at 'http://localhost:9008/Notification' with contract(s) '"NotificationServicePortType"' is unable to open its IChannelListener. ---> System.InvalidOperationException: A registration already exists for URI 'http://localhost:9008/Notification'.
       at System.ServiceModel.Channels.UriPrefixTable`1.RegisterUri(Uri uri, HostNameComparisonMode hostNameComparisonMode, TItem item)
       at System.ServiceModel.Channels.HttpTransportManager.Register(TransportChannelListener channelListener)
       at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
       at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
       at System.ServiceModel.Channels.HttpChannelListener.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
       --- End of inner exception stack trace ---
       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 WCFServiceHost.Form1.button2_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    I instantiate the Service Host with:

    ServiceHost MyHost = new ServiceHost(CurrentNotification, new Uri("http://localhost:9008/Notification");
    MyHost.Open();

    Would the fact that this is deployed on a clustered environment cause this problem?

    Here is the endpoint in the appconfig:

    <services>
      <service name="EWS_WCF_Notification.Notification" behaviorConfiguration="NotificationBehavior">
        <endpoint address="" contract="NotificationServicePortType" binding="basicHttpBinding" bindingName="NotificationServiceBinding" bindingNamespace="http://schemas.microsoft.com/exchange/services/2006/messages"/>
      </service>
    </services>
    



     

    Wednesday, June 12, 2013 12:00 PM

Answers

All replies