I have a Windows Azure desktop where the WCF service is located. This service must be used by the Silverlight application. Locally, this works fine, however, when I try to deploy it, the endpoint must be configured in the role configuration (see the figure below).

When I delete this โWCFEndpointโ endpoint, everything works fine locally. However, when it exists, the following exception occurs:
System.ServiceModel.AddressAlreadyInUseException: HTTP konnte die URL " http: // +: 9196 / GreenwayService / " nicht registrieren, weil der TCP-Port 9196 von einer anderen Anwendung verwendet wird.
which means in English: HTTP could not register the URL "..." because TCP PORT 9196 is being used by another application.
As far as I understand, the endpoint must be defined as in the picture in order to be accessible inside the cloud.
Here is my app.config:
<?xml version="1.0"?> <configuration> <system.diagnostics> <trace> <listeners> <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics"> <filter type=""/> </add> </listeners> </trace> </system.diagnostics> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup><system.serviceModel> <services> <service name="Greenway.AzureWorkerRole.ServiceHosting.CrossDomainService"> <endpoint address="" behaviorConfiguration="HttpEnableBehavior" binding="webHttpBinding" contract="Greenway.AzureWorkerRole.ServiceHosting.ICrossDomainService" /> <host> <baseAddresses> <add baseAddress="http://localhost:9196/" /> </baseAddresses> </host> </service> <service behaviorConfiguration="GreenwayServiceBehavior" name="Greenway.AzureWorkerRole.ServiceHosting.GreenwayService"> <endpoint address="" binding="basicHttpBinding" contract="Greenway.AzureWorkerRole.ServiceHosting.IGreenwayService" /> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> <host> <baseAddresses> <add baseAddress="http://localhost:9196/GreenwayService/" /> </baseAddresses> </host> </service> </services> <behaviors> <endpointBehaviors> <behavior name="HttpEnableBehavior"> <webHttp/> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior name="GreenwayServiceBehavior"> <serviceMetadata httpGetEnabled="True"/> <serviceDebug includeExceptionDetailInFaults="False" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration>
And this is a piece of code starting the services:
ServiceHost greenwayServiceHost = new ServiceHost(typeof(GreenwayService)); ServiceHost crossDomainServiceHost = new ServiceHost(typeof(CrossDomainService)); greenwayServiceHost.Open(); crossDomainServiceHost.Open();
What do I need to change inside these three places to host services inside the cloud?
source share