Question

I have a windows service application which works using remoting. It is used to display baloon tip. However, it sometimes throws this error:

Exception :Requested Service not found
Inner Exception : Stack Trace : Server stack trace: at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream) 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 Baloontip.clsBaloonTool.Messagebox(String Message)

Can any body please help me with this issue.

Was it helpful?

Solution

If the error occurs after some time, it is possible that you doesn´t override the InitializeLifetimeService method of the base class MarshalByRefObject.

By default, if you doesn´t override the method, the remote object is destroyed after some time (I think 5 minutes). If you override the method and return null, the object has an endless life time.

public override object InitializeLifetimeService() {
  return null;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top