我正在关注John Sharp的“Windows Communication Foundation 4”中的示例。第88-89页显示了如何注册和启动服务。我的服务无法启动。当试图“启动”Windows服务时,出现错误
我必须说,在我自己的主机使用的net.tcp我不能运行该服务,因为它抱怨上当受骗的端口,则应当使用了NamedPipes。
在应用程序日志中的错误是
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...
你的帮助是非常赞赏。