[remoting] Set fRefine to false in call to Unmarshal(ObjRef) Fixes #49308 #5863
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
However if the server type has a
ProxyAttribute
custom attribute, setfRefine
back to true.
This matches logic in
InternalUnmarshal
inhttps://github.com/mono/mono/blob/master/mcs/class/referencesource/mscorlib/system/runtime/remoting/remotingservices.cs#L834
The issue is that we may deserialize an
ObjRef
in some domain (domain2) when aMarshalByRef
instance is passed as an argument to a method of a server objectrunning in domain2. The observed .NET framework behavior is that this should
not cause domain2 to try to load the type (and consequently the assembly) of
the
MarshalByRef
object (except in the case where it's actually aContextBoundObject
that has aProxyAttribute
). (Note however that thetransparent proxy of the
MarshalByRef
instance in domain2 must be handledlightly - as long as its treated as an opaque reference and just loaded/stored
from
System.Object
variables or members, the type won't be loaded).Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=49308