Wcf System.ServiceModel.AddressAlreadyInUseException

Sorry if this question appears twice in stackOverflow

I try to start the wcf service on a Windows Server 2003 window. I get a System.ServiceModel.AddressAlreadyInUseException exception when servicehost calls Open () and it tells me the following error:

HTTP was unable to register the URL http: // +: 8080 / LogoResizer / mex / because TCP port 8080 is being used by another application

I read that I need to use httpcfg.exe to register my namespace, and Ive used the GUI tool found here to do this, but I still get the exception above. Running "netstat -a" shows nothing else listening on port 8080, and running "httpcfg.exe query urlacl" returns me the following registered namespaces.

C: \ Program Files \ Support Tools> httpcfg query urlacl URL: http: // +: 80 / Temporary_Listen_Addresses /

ACL: D: (A ;; GX ;;; WD)

URL : http://+:8080/LogoResizer/ 

ACL: D: (A ;; GX ;;; WD)

 URL : http://+:8080/LogoResizer/mex/ 

ACL: D: (A ;; GX ;;; WD)

The configuration for my application is as follows:

 <system.serviceModel> <bindings> <netTcpBinding> <binding name="NetTcpBinding_ImageResizerServiceContract" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> <security mode="Transport"> <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" /> <message clientCredentialType="Windows" /> </security> </binding> </netTcpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior name="ServiceBehavior"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> <services> <service name="LogoResizer.WCF.ServiceTypes.ImageResizerService" behaviorConfiguration="ServiceBehavior"> <host> <baseAddresses> <add baseAddress="http://localhost:900/mex/"/> <add baseAddress="net.tcp://localhost:9000/" /> </baseAddresses> </host> <endpoint bindingConfiguration="NetTcpBinding_ImageResizerServiceContract" binding="netTcpBinding" contract="LogoResizer.WCF.ServiceContracts.IImageResizerService" /> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> </system.serviceModel> 

Does anyone know what I'm doing wrong or how can I register my namespace so that I can have an http endpoint for my service?

+3
source share
1 answer

I worked.

The problem was that both of my endpoints were running from the same port. This is not a problem when developing for Windows XP, but it will give you the exceptions that I wrote about when I tried to start the service under Vista or Windows Server 2003. I just needed to update my server configuration to the next

  <baseAddresses> <add baseAddress="http://localhost:9000/mex/"/> <add baseAddress="net.tcp://localhost:9001/" /> </baseAddresses> 
+5
source

All Articles