From f55ee1e3b489f3243ea98764a61ae67d5592bf1b Mon Sep 17 00:00:00 2001 From: Callum Noble Date: Tue, 19 Dec 2017 16:30:04 -0800 Subject: [PATCH] Fixed errors breaking .NET Remoting on method invoke (#276) --- AUTHORS.md | 1 + CHANGELOG.md | 1 + src/runtime/converter.cs | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index 66e025039..55aa69d11 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -14,6 +14,7 @@ - Arvid JB ([@ArvidJB](https://github.com/ArvidJB)) - Bradley Friedman ([@leith-bartrich](https://github.com/leith-bartrich)) +- Callum Noble ([@callumnoble](https://github.com/callumnoble)) - Christian Heimes ([@tiran](https://github.com/tiran)) - Christoph Gohlke ([@cgohlke](https://github.com/cgohlke)) - Christopher Pow ([@christopherpow](https://github.com/christopherpow)) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d0dcd6de..96461ca68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][]. - Fixed double calling of constructor when deriving from .NET class (#495) - Fixed `clr.GetClrType` when iterating over `System` members (#607) - Fixed `LockRecursionException` when loading assemblies (#627) +- Fixed errors breaking .NET Remoting on method invoke (#276) ## [2.3.0][] - 2017-03-11 diff --git a/src/runtime/converter.cs b/src/runtime/converter.cs index 5179c849b..13498e3dc 100644 --- a/src/runtime/converter.cs +++ b/src/runtime/converter.cs @@ -155,7 +155,15 @@ internal static IntPtr ToPython(object value, Type type) var pyderived = value as IPythonDerivedType; if (null != pyderived) { + #if NETSTANDARD return ClassDerivedObject.ToPython(pyderived); + #else + // if object is remote don't do this + if (!System.Runtime.Remoting.RemotingServices.IsTransparentProxy(pyderived)) + { + return ClassDerivedObject.ToPython(pyderived); + } + #endif } // hmm - from Python, we almost never care what the declared