I have a DLL that exposes this C# event:
[Serializable]
public delegate object[] MyEventHandler(object[] data);
event MyEventHandler MyEvent;
and python code which subscribes to it:
...
def MyPythonEventHandler(source, args):
print 'Inside Event Handler'
...
ref.MyEvent += MyPythonEventHandler
...
When the DLL fires the event, the print statement in MyPythonEventHandler is not reached; instead Python throws a ConversionException. Because the exception isn't serializable, the DLL actually receives this exception:
System.Runtime.Serialization.SerializationException: Type 'Python.Runtime.
ConversionException' in Assembly 'Python.Runtime, Version=2.0.0.2, Culture=neutral,
PublicKeyToken=null' is not marked as serializable.
So I can't actually tell what conversion is being attempted and is failing.
I successfully handle other event callbacks from this DLL, so I'm guessing this failure has to do with this particular event's delegate signature. Is my python handler's signature wrong?
Thanks, Jim