-
Notifications
You must be signed in to change notification settings - Fork 748
remove remoting block for .NET standard #1170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
If this is the only line where it is used, can we replace it with runtime feature detection instead of completely removing a feature? E.g. static readonly Func<object, bool> IsTransparentProxy = GetIsTransparentProxy();
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);
} P.S. @filmor Travis CI results are not being picked up... |
@lostmsu its a good idea but this isn't a tested feature and I don't want to build a test for it. Are you confident your code will work without tests? |
@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 } |
@lostmsu as long as I'm not signing up for testing remoting, I am ok with that. I'll push an update with your change and remove the changelog entry |
@koubaa , yeah, let's do that. |
Codecov Report
@@ Coverage Diff @@
## master #1170 +/- ##
=======================================
Coverage 86.25% 86.25%
=======================================
Files 1 1
Lines 291 291
=======================================
Hits 251 251
Misses 40 40
Continue to review full report at Codecov.
|
What does this implement/fix? Explain your changes.
Remove remoting support
Does this close any currently open issues?
Removes some dependency on .NET framework
Any other comments?
...
Checklist
Check all those that are applicable and complete.
AUTHORS
CHANGELOG