-1

I am following the example in "Windows Communication Foundation 4" by John Sharp. Page 88-89 shows how to register and start a service. My service does not start.

I need to say that I could not run the service using net.tcp in my own host as it complained about the port being taken and this one should use namedPipes.

The error in the application log is

Service cannot be started. System.ServiceModel.AddressAlreadyInUseException: HTTP could not register URL http://+:8080/ProductsService/Service.svc/ because TCP port 8080 is being used by another application. ---> System.Net.HttpListenerException: The process cannot access the file because it is being used by another process
   at System.Net.HttpListener.AddAllPrefixes()
   at System.Net.HttpListener.Start()
   at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
   --- End of inner exception stack trace ---
   at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
   at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
   at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
   at System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.HttpChannelListener.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.Communicat...

Your help is much appreciated.

Stewbob
  • 16,759
  • 9
  • 63
  • 107
user1313589
  • 1
  • 1
  • 1

2 Answers2

4

As it says in the first line of your error

HTTP could not register URL http://+:8080/ProductsService/Service.svc/ because TCP port 8080 is being used by another application.

you are trying to register on port 8080, but port 8080 is being used by another application. Try changing the port number until you find one that is not in use.

yoozer8
  • 7,361
  • 7
  • 58
  • 93
2

Another service is using that port

try 8084

Sully
  • 14,672
  • 5
  • 54
  • 79