找不到请求的服务 [英] Requested Service not found

查看:1069
本文介绍了找不到请求的服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个工程,并使用远程Windows服务应用程序。它被用来显示气球尖端。但是,它有时会抛出这个错误:

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.

推荐答案

如果一段时间后发生错误,则可能是您doesn't覆盖 InitializeLifetimeService 方法基类的<一href="http://msdn.microsoft.com/en-us/library/system.marshalbyrefobject.aspx">MarshalByRefObject.

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

在默认情况下,如果你doesn't覆盖的方法,远程对象是经过一段时间后销毁(我认为5分钟)。如果覆盖的方法,并返回空值,对象有一个无限的续航时间。

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 object InitializeLifetimeService(){
  return null;
}

这篇关于找不到请求的服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆