我面臨的一個奇怪的問題與Windows服務到Windows窗體通信基礎WCF的無終點命名管道服務(通知托盤)應用程序中使用WCF基於命名管道的終點。(.NET Framework 4.0中)具體應用
安裝完成後,服務會正確地將消息發送到我的winform(通知托盤)應用程序,並按預期工作。
但是,一旦我重新啓動機器。該服務無法找到Namedpipe端點。我嘗試通過從VS 2010創建另一個應用程序來發送消息,並且它能夠將消息發送到我的Windows窗體(Notification Tray)應用程序。
的Windows服務引發的例外是
There was no endpoint listening at net.pipe://localhost/Pipe/Pipe1 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Error innerException : System.IO.PipeException: The pipe endpoint 'net.pipe://localhost/Pipe/Pipe1' could not be found on your local machine.
Error stackStrace : Server stack trace: at System.ServiceModel.Channels.PipeConnectionInitiator.GetPipeName(Uri uri, IPipeTransportFactorySettings transportFactorySettings) at System.ServiceModel.Channels.NamedPipeConnectionPoolRegistry.NamedPipeConnectionPool.GetPoolKey(EndpointAddress address, Uri via) at System.ServiceModel.Channels.CommunicationPool`2.TakeConnection(EndpointAddress address, Uri via, TimeSpan timeout, TKey& key) at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout) at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at NamedPipe.Communication.IPipeService.PipeIn(String data) at NamedPipe.Sender.SendMessage(String messages, String PipeName) at NamedPipe.Sender.SendMessage(String messages).
你的winform應用程序正在運行嗎? – Paparazzi
是的,我的winform應用程序正在運行,它也出現在托盤圖標中。它還顯示通知氣球,當從控制檯應用程序或其他應用程序中擊中命名管道時(在機器重新啓動時,即Windows服務無法通信時)。 –