Support for CLR4 .NET Remoting
Does pythonnet-2.1.0 support .NET Remoting? When I try to get an interface, python 2.7 crashes: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Python.Runtime.ClassDerivedObject.ToPython(IPythonDerivedType obj) at Python.Runtime.Converter.ToPython(Object value, Type type) at Python.Runtime.MethodBinder.Invoke(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, MethodInfo[] methodinfo) at Python.Runtime.MethodObject.Invoke(IntPtr target, IntPtr args, IntPtr kw,MethodBase info) at Python.Runtime.MethodBinding.tp_call(IntPtr ob, IntPtr args, IntPtr kw) It's getting past these lines in my script: import clr clr.Addreference(my remoting DLL) from MyNamespace import * and choking on a static method in my app's remoting DLL call which returns the interface. Through logging, I can tell that the code in that static method call is successfully executing: (IMyInterface)Activator.GetObject(typeof(IMyInterface), url); and returning the object back to Python. This worked fine before when my app targeted .NET 3.5 and I used the CLR2 version of the Python for .NET package. Now my app targets .NET 4.5.2 so I: - Updated to Python 2.7.12 - Updated the copy of my app's remoting DLL in c:\python27\dll - Removed the old Python for .NET package - Executed "pip install pythonnet", which gave me version 2.1.0. In C:\Python27\Lib\site-packages\ I see: clr.pyd Python.Runtime.dll v 2.0.0.2 Python.Runtime.dll.config
Can you provide minimal reproducible code sample for both C# and Python? What is the latest pythonnet version in which this works? Are you testing this from interactive python or ipython? There are some differences between the 2 options. Please also open an issue on github. BTW, why have you not switched to WCF? Thanks, Denis
participants (2)
-
Denis Akhiyarov
-
pythondotnet