[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Problems with remoting objects which hosted in Windows Service

notacat

7/31/2004 1:37:00 PM

My Remoting service objects works fine when hosted in a plain Console Application.
But when I run it in a Windows Service, it works only partially. Clients can make calls to its' methods, but can't subscribe onto its' events. When client tries to do something like this:

MyObject.MyObjectEvent += new MyObjectEventHandler(myObjectEventHandler);

occures the next Exception:

ArgumentException: 'Error binging to target method'

Server stack trace:
at System.Delegate.InternalCreate(Object target, String method, Boolean ignoreCase)
at System.Delegate.CreateDelegate(Type type, Object target, String method)
at System.DelegateSerializationHolder.GetDelegate(DelegateEntry de)
at System.DelegateSerializationHolder.GetRealObject(StreamingContext context)
at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.UnsafeDeserialize(Stream serializationStream, HeaderHandler handler)
at System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel securityLevel)
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 DriverPack1.Geor.IGeor.add_StateChanged(StateChanged value)
at IdObjectType_83ea868f_4cd9_4b7d_a237_5addaf58f3e9.RemoteProxy.OnInnerObjectIsNonNull(Object)
at Uranus.Implementation.RemoteProxyBase.TryToGetLocalProxy() in c:\CurrentVersion\Uranus.Application\RemoteProxyBase.cs:line 65
at Uranus.Implementation.RemoteProxyBase.Uranus.Implementation.ServerConnection+IClient.CollectionChanged() in c:\CurrentVersion\Uranus.Application\RemoteProxyBase.cs:line 106
at Uranus.Implementation.ServerConnection.CollectionChanged() in c:\CurrentVersion\Uranus.Application\RemoteProxyBase.cs:line 379
at Uranus.Implementation.ServerConnection.PingAndRestoreLoop() in c:\CurrentVersion\Uranus.Application\RemoteProxyBase.cs:line 321
at Uranus.Implementation.ServerConnection.PingAndRestore() in c:\CurrentVersion\Uranus.Application\RemoteProxyBase.cs:line 292

Thank you for any idea


3 Answers

Sunny

7/31/2004 8:42:00 PM

0

How and in what class is myObjectEventHandler method declared? Is it
public? Does the server has access to the assembly in which this class
is implemented?

Sunny


In article <ABA477F4-5F11-4307-8669-B30EFCCF2A0C@microsoft.com>,
notacat@bk.ru says...
> My Remoting service objects works fine when hosted in a plain Console Application.
> But when I run it in a Windows Service, it works only partially. Clients can make calls to its' methods, but can't subscribe onto its' events. When client tries to do something like this:
>
> MyObject.MyObjectEvent += new MyObjectEventHandler(myObjectEventHandler);
>
> occures the next Exception:
>
> ArgumentException: 'Error binging to target method'
>
> Server stack trace:
> at System.Delegate.InternalCreate(Object target, String method, Boolean ignoreCase)
> at System.Delegate.CreateDelegate(Type type, Object target, String method)
> at System.DelegateSerializationHolder.GetDelegate(DelegateEntry de)
> at System.DelegateSerializationHolder.GetRealObject(StreamingContext context)
> at System.Runtime.Serialization.ObjectManager.ResolveObjectReference(ObjectHolder holder)
> at System.Runtime.Serialization.ObjectManager.DoFixups()
> at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage methodCallMessage)
> at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, IMethodCallMessage methodCallMessage)
> at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.UnsafeDeserialize(Stream serializationStream, HeaderHandler handler)
> at System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel securityLevel)
> 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 DriverPack1.Geor.IGeor.add_StateChanged(StateChanged value)
> at IdObjectType_83ea868f_4cd9_4b7d_a237_5addaf58f3e9.RemoteProxy.OnInnerObjectIsNonNull(Object)
> at Uranus.Implementation.RemoteProxyBase.TryToGetLocalProxy() in c:\CurrentVersion\Uranus.Application\RemoteProxyBase.cs:line 65
> at Uranus.Implementation.RemoteProxyBase.Uranus.Implementation.ServerConnection+IClient.CollectionChanged() in c:\CurrentVersion\Uranus.Application\RemoteProxyBase.cs:line 106
> at Uranus.Implementation.ServerConnection.CollectionChanged() in c:\CurrentVersion\Uranus.Application\RemoteProxyBase.cs:line 379
> at Uranus.Implementation.ServerConnection.PingAndRestoreLoop() in c:\CurrentVersion\Uranus.Application\RemoteProxyBase.cs:line 321
> at Uranus.Implementation.ServerConnection.PingAndRestore() in c:\CurrentVersion\Uranus.Application\RemoteProxyBase.cs:line 292
>
> Thank you for any idea
>
>
>

notacat

8/1/2004 6:09:00 AM

0



"Sunny" wrote:

> How and in what class is myObjectEventHandler method declared? Is it
> public? Does the server has access to the assembly in which this class
> is implemented?
>
myObjectEventHandler is public and server has access to assembly in which this class is implemented.
And all works fine when server running as console application.

Sunny

8/1/2004 4:21:00 PM

0

Hi,
I haven't experience this problem so far. Can you try to provide a short
but complete program, so I can take a look?

Please, read Jon Skeet's article about short but complete program:

http://www.yoda.arachsys.com/csharp/com...

Sunny


In article <04AA7E10-6D5C-4ED8-AA81-FE381C0A547A@microsoft.com>,
notacat@bk.ru says...
>
>
> "Sunny" wrote:
>
> > How and in what class is myObjectEventHandler method declared? Is it
> > public? Does the server has access to the assembly in which this class
> > is implemented?
> >
> myObjectEventHandler is public and server has access to assembly in which this class is implemented.
> And all works fine when server running as console application.
>