remove remoting block for .NET standard by koubaa · Pull Request #1170 · pythonnet/pythonnet

@koubaa the calls to this method probably have some coverage, so if it crashes, we should see in CI. The feature itself might be broken with this, but IMO it is better, than removing it completely.

Besides, I did some testing:

.NET Framework

> using System;
> static bool Never(object _) => false;
>
> static Func<object, bool> GetIsTransparentProxy() {
.   var remoting = typeof(int).Assembly.GetType("System.Runtime.Remoting.RemotingServices");
.   if (remoting is null) return Never;
.
.   var isProxy = remoting.GetMethod("IsTransparentProxy", new []{typeof(object)});
.   if (isProxy is null) return Never;
.
.   return (Func<object, bool>)Delegate.CreateDelegate(
.     typeof(Func<object, bool>), isProxy,
.     throwOnBindFailure: true);
. }
> var d = GetIsTransparentProxy();
> d
Func<object, bool> { Method=[Boolean IsTransparentProxy(System.Object)], Target=null }
> d(new object())
false

.NET Core

> Console.WriteLine(IsTransparentProxy.Method);
Boolean Never(System.Object)

Mono

> var d = GetIsTransparentProxy();
> d
Func<object, bool> { Method=[Boolean IsTransparentProxy(System.Object)], Target=null }