[Python.NET] Support for CLR4 .NET Remoting

pythondotnet PythonDotNet at jnpcarole.com
Mon Oct 24 16:32:50 EDT 2016


 
> Can you provide minimal reproducible code sample for both C# and Python?
Tried uploading a .zip file to GitHub but got error "We don't support that file type." Instead I put a dropbox file link in the issue.

 > What is the latest pythonnet version in which this works?
I only ever used pythonnet-2.0-alpha2-clr2.0_131_py27_UCS2 with Python 2.7.2, where it worked when controlling my .Net 3.5-based-based GUI app. I only updated my app to .NET 4.5.2 last week, which is the first time I tried CLR4-compatible PythonDotNet with Python 2.7.12.

 > Are you testing this from interactive python or ipython? There are some
 differences between the 2 options.
 - Command shell:  C:\Python27> python my.py

 > Please also open an issue on github.
 Done: ".NET Remoting support broken  #276" 

 > BTW, why have you not switched to WCF?
- Yeah, I know, Remoting is deprecated : (  Need to learn about WCF and see what kind of pain it will cause my long-established user base.
--------- Original Message --------- Subject: PythonDotNet Digest, Vol 147, Issue 18
From: pythondotnet-request at python.org
Date: 10/21/16 10:00 am
To: pythondotnet at python.org

Send PythonDotNet mailing list submissions to
 pythondotnet at python.org
 
 To subscribe or unsubscribe via the World Wide Web, visit
 https://mail.python.org/mailman/listinfo/pythondotnet
 or, via email, send a message with subject or body 'help' to
 pythondotnet-request at python.org
 
 You can reach the person managing the list at
 pythondotnet-owner at python.org
 
 When replying, please edit your Subject line so it is more specific
 than "Re: Contents of PythonDotNet digest..."
 
 
 Today's Topics:
 
 1. Support for CLR4 .NET Remoting (pythondotnet)
 2. Re: Support for CLR4 .NET Remoting (Denis Akhiyarov)
 
 
 ----------------------------------------------------------------------
 
 Message: 1
 Date: Thu, 20 Oct 2016 10:38:28 -0700
 From: "pythondotnet" <PythonDotNet at jnpcarole.com>
 To: pythondotnet at python.org
 Subject: [Python.NET] Support for CLR4 .NET Remoting
 Message-ID:
 <20161020103828.3e63f68611bc0deecd5a6dd5fef89a2f.fe160eb814.mailapi at email09.godaddy.com>
 
 Content-Type: text/plain; charset="utf-8"
 
 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
 -------------- next part --------------
 An HTML attachment was scrubbed...
 URL: <http://mail.python.org/pipermail/pythondotnet/attachments/20161020/433148c7/attachment-0001.html>
 
 ------------------------------
 
 Message: 2
 Date: Thu, 20 Oct 2016 13:01:48 -0500
 From: Denis Akhiyarov <denis.akhiyarov at gmail.com>
 To: "A list for users and developers of Python for .NET"
 <pythondotnet at python.org>
 Subject: Re: [Python.NET] Support for CLR4 .NET Remoting
 Message-ID:
 <CALxxJLQFqkMxSs4FvekYcJMNYikPuWZB3W1u+AW4LCSROyOvBA at mail.gmail.com>
 Content-Type: text/plain; charset="utf-8"
 
 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
 -------------- next part --------------
 An HTML attachment was scrubbed...
 URL: <http://mail.python.org/pipermail/pythondotnet/attachments/20161020/c7b05f88/attachment-0001.html>
 
 ------------------------------
 
 Subject: Digest Footer
 
 _______________________________________________
 PythonDotNet mailing list
 PythonDotNet at python.org
 https://mail.python.org/mailman/listinfo/pythondotnet
 
 
 ------------------------------
 
 End of PythonDotNet Digest, Vol 147, Issue 18
 *********************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythondotnet/attachments/20161024/182328ca/attachment.html>


More information about the PythonDotNet mailing list