我正在關注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...
你的幫助是非常讚賞。