I am using a seperate process. After I include IronPython.dll in the library where my remote object is implemented, I get the following exception: "Attempted to call a method declared on type 'IronPython.Runtime.IDynamicObject' on an object which exposes 'RemotingServerClient.ServerTalk'." (RemotingServerClient.ServerTalk is my remote object)
If you need the stacktrace, see the attachment.

I also have another problem. I was trying to get an event via remoting from the server back to my client (using client activated objects setting). I include a library in both the server as the python client in which my remote object is implemented. This also contains a delegate to be used for the event. When I try to register a delegate from the python client, I get the following exception: Cannot serialize delegates over unmanaged function pointers, dynamic methods or methods outside the delegate creator's assembly.
When using a c# client, this works ok.

Thanks for your help.
Ralph Soons

From: Dino Viehland <[EMAIL PROTECTED]>
Reply-To: Discussion of IronPython <[email protected]>
To: Discussion of IronPython <[email protected]>
Subject: Re: [IronPython] remoting from IronPython
Date: Wed, 14 Jun 2006 17:16:03 -0700

Are you remoting to another process, or to another app domain? Does the other process have access to IronPython.dll ?

One thing you might want to try doing is installing IronPython into the GAC (assuming this is beta 7, or if you re-built w/ the Signed Release or Signed Debug build modes w/ your own key), and then try this. This would ensure that the type would be loadable in both app domains, even if the files aren't readily available. It's also go a long way to making sure we're getting loaded into the correct loader context.

Another helpful debugging tip for debugging CLR interaction issues is running IronPythonConsole w/ the -X:ExceptionDetail option. That will get you a much better stack trace about where the issue is occurring.

I'd need to get some time to setup a repro to be able to say much more about this - but it's definitely something we'll want to make works (or understand why it doesn't if it's impossible to make work) before 1.0.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ralph Soons
Sent: Wednesday, June 14, 2006 6:57 AM
To: [email protected]
Subject: Re: [IronPython] remoting from IronPython

Hi again,

I searched a little further and found out the following:

When using remoting - server activated objects:
and s = NameSpace.RemoteObject()
I discovered the "Cannot load type 'clr:IronPython.Runtime.IDynamicObject,
IronPython...." exception occurs on the following location:
namespace: IronPython.Runtime
file: Ops.cs
funtion: public static DynamicType GetDynamicType(object o) {
Line: if (dt != null) return dt.GetDynamicType(); (line 562)

during debuging I discovered that 'object o' (input of the function) is of type MarshalByRefObject so I guess its my remote object. The first line in the function is IDynamicObject dt = o as IDynamicObject;. dt is not null after executing this line. This is strange because its being casted to IDynamicObject, which isn't implemented by my remote object. There after when the next line is executed if (dt != null) return dt.GetDynamicType();, the exception occurs.
Can anyone tell me why this is going wrong?

I also tried to use client activated objects. In that case the remoting call is working correctly.

Thanks for your help again.
Ralph Soons

>From: "Ralph Soons" <[EMAIL PROTECTED]>
>Reply-To: Discussion of IronPython <[email protected]>
>To: [email protected]
>Subject: [IronPython] remoting from IronPython
>Date: Wed, 14 Jun 2006 09:09:57 +0200
>
>Hi all,
>
>I am trying to call an function on a server via remoting, using IronPython.
>First I created a c# server/client to test everything.
>
>In the C# client I have the following code:
>RemotingConfiguration.Configure("executablename.exe.config", false);
>RemoteObject object = new RemoteObject(); I can now reach my remote
>object from the client.
>
>There after I used IronPython to do the same in python:
>System.Runtime.Remoting.RemotingConfiguration.Configure("IronPythonTest
>.exe.config",
>0)
>s = NameSpace.RemoteObject()
>I now get the following error:
>Cannot load type 'clr:IronPython.Runtime.IDynamicObject, IronPython
>
>I also tried:
>s = System.Activator.GetObject(
>System.Type.GetType(NameSpace.RemoteObject),
>"http://localhost:9000/mytest"; )
>I then get this error:
>#  File , line 0, in GetObject##10
>#  File mscorlib, line unknown, in GetObject
>#SystemError: Trying to create a proxy to an unbound type.
>
>Can someone tell me if its possible to use remoting from IronPython or
>does any one has an idea what I am doing wrong?
>
>Many thanks!
>Ralph Soons
>
>_________________________________________________________________
>Play online games with your friends with MSN Messenger
>http://www.join.msn.com/messenger/overview
>
>_______________________________________________
>users mailing list
>[email protected]
>http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

_________________________________________________________________
MSN Search, for accurate results! http://search.msn.nl

_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

_________________________________________________________________
Play online games with your friends with MSN Messenger http://www.join.msn.com/messenger/overview
IronPython 1.0.2357 (Beta) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
execfile("RemotingCall2.py")
Attempted to call a method declared on type 'IronPython.Runtime.IDynamicObject' on an object which exposes 'RemotingServerClient.ServerTalk'.

Server stack trace:
at System.Runtime.Remoting.Messaging.StackBuilderSink.VerifyIsOkToCallMethod(Object server, IMethodMessage msg) at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

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 IronPython.Runtime.IDynamicObject.GetDynamicType()
at IronPython.Runtime.Ops.GetDynamicType(Object o) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\Ops.cs:line 562 at IronPython.Runtime.PythonType.InvokeInit(Object inst, Object[] args) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\PythonType.cs:line 440 at IronPython.Runtime.ReflectedType.Call(ICallerContext context, Object[] args) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\ReflectedType.cs:line 965 at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object func, Object[] args) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\Ops.cs:line 1242 at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object func) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\Ops.Generated.cs:line 118
  at RemotingCall2.py##4(Frame )
  at IronPython.Runtime.FrameCodeDelegate.Invoke(Frame frame)
at IronPython.Runtime.FrameCode.Run(Frame frame) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\Frame.cs:line 195 at IronPython.Modules.Builtin.ExecFile(ICallerContext context, Object filename, Object globals, Object locals) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Modules\Builtin.cs:li
ne 361
at IronPython.Modules.Builtin.ExecFile(ICallerContext context, Object filename) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Modules\Builtin.cs:line 321
  at ExecFile##1(Object , Object )
  at IronPython.Runtime.CallTarget2.Invoke(Object arg0, Object arg1)
at IronPython.Runtime.OptimizedFunctionAny.Call(Object arg0, Object arg1) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\BuiltinFunction.Generated.cs:line 521 at IronPython.Runtime.OptimizedFunctionAny.Call(Object[] args) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\BuiltinFunction.Generated.cs:line 560 at IronPython.Runtime.ReflectedMethodBase.TryOptimizedCall(Object[] args, Object& ret) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\ReflectedMethod.cs:line 173 at IronPython.Runtime.ReflectedMethodBase.TryCallWorker(Object[] args, Object& ret) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\ReflectedMethod.cs:line 557 at IronPython.Runtime.ReflectedMethodBase.Call(Object[] args) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\ReflectedMethod.cs:line 120 at IronPython.Runtime.ReflectedMethodBase.Call(ICallerContext context, Object[] args) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\ReflectedMethod.cs:line 134 at IronPython.Runtime.ReflectedMethodBase.Call(ICallerContext context, Object arg0) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\ReflectedMethod.Generated.cs:line 38 at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object func, Object arg0) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\Ops.Generated.cs:line 123
  at <stdin>##0(Frame )
  at IronPython.Runtime.FrameCodeDelegate.Invoke(Frame frame)
at IronPython.Runtime.FrameCode.Run(Frame frame) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Runtime\Frame.cs:line 195 at IronPython.Hosting.PythonEngine.DoOneInteractive(Frame topFrame) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Hosting\PythonEngine.cs:line 441 at IronPython.Hosting.PythonEngine.<RunInteractiveLoop>b__3(Boolean& continueInteractionArgument) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Hosting\PythonEngine.cs:line 205 at IronPython.Hosting.PythonEngine.TryInteractiveAction(InteractiveAction interactiveAction, Boolean& continueInteraction) in C:\Documents and Settings\rsoons\My Documents\Visual Studio 2005\IronPython\IronPython-1.0-Beta7\Src\IronPython\Hosting\P
ythonEngine.cs:line 167
SystemError: Attempted to call a method declared on type 'IronPython.Runtime.IDynamicObject' on an object which exposes 'RemotingServerClient.ServerTalk'.

_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to