all groups > dotnet remoting > july 2004 >
You're in the

dotnet remoting

group:

Problems with remoting objects which hosted in Windows Service


Problems with remoting objects which hosted in Windows Service notacat
7/31/2004 6:37:03 AM
dotnet remoting: 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

Re: Problems with remoting objects which hosted in Windows Service Sunny
7/31/2004 3:41:47 PM
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...
[quoted text, click to view]
Re: Problems with remoting objects which hosted in Windows Service notacat
7/31/2004 11:09:03 PM


[quoted text, click to view]
myObjectEventHandler is public and server has access to assembly in which this class is implemented.
Re: Problems with remoting objects which hosted in Windows Service Sunny
8/1/2004 11:20:39 AM
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/complete.html

Sunny


In article <04AA7E10-6D5C-4ED8-AA81-FE381C0A547A@microsoft.com>,
notacat@bk.ru says...
[quoted text, click to view]
AddThis Social Bookmark Button