Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
error message:
A binding instance has already been associated to listen URI 'http://localhost:8080/RemService'. If two endpoints want to share the same ListenUri, they must also share the same binding object instance. The two conflicting endpoints were either specified in AddServiceEndpoint() calls, in a config file, or a combination of AddServiceEndpoint() and config.

CODE :
C#
using (System.ServiceModel.ServiceHost host = new System.ServiceModel.ServiceHost(typeof(REMService.REMServices)))
            {
                host.Open();
                Console.WriteLine("Service Started at" + DateTime.Now);
                Console.ReadLine();
            }


What I have tried:

XML
<configuration>
  <system.servicemodel>
    <services>
      <service name="REMService.REMServices" behaviorConfiguration="mexBehavior">
        <endpoint name="basic" address="RemService" binding="basicHttpBinding" contract="REMService.IREMServices">
        <endpoint address="RemService" binding="netHttpBinding" contract="REMService.IREMServices">
        <endpoint name="mex" address="mex" binding="mexHttpBinding" contract="IMetadataExchange">
        <host>
          <baseaddresses>
            <add baseAddress="http://localhost:8080/"/>
            <add baseAddress="net.tcp://localhost:8090/"/>
          
        
        
      
    
    <behaviors>
      <servicebehaviors>
        <behavior name="mexBehavior">
          <serviceMetadata httpGetEnabled="true"/>
        
      
    
  
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
Posted
Updated 23-Apr-17 3:52am
v2

1 solution

HTML
<endpoint name="basic" address="RemService" binding="basicHttpBinding" contract="REMService.IREMServices">
<endpoint address="RemService" binding="netHttpBinding" contract="REMService.IREMServices">

These to endpoints share the same address - it is impossible... change the address for one of them or remove the unnecessary...
 
Share this answer
 
Comments
awaisshabir 23-Apr-17 13:23pm    
when i change address then it show below error.

Additional information: HTTP could not register URL http://+:8080/. Your process does not have access rights to this namespace

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900