Requested Service not found
Asked Answered
D

1

18

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.

Deedee answered 16/4, 2010 at 9:24 Comment(1)
Please post the code that is causing this exception to appear.Lodovico
J
23

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;
}
Junket answered 16/4, 2010 at 9:29 Comment(2)
Man you saved me! I don't know enough about remoting and it would have taken me forever to figure this out without this answer!Soutine
Hi Jehof, you saved me too! I have spent many 5 minutes today for testing the remoting service vanishing problem in my hooking system. Thank you for the great advice!Sunfish

© 2022 - 2024 — McMap. All rights reserved.