2006-07-15 Jonathan Chambers <joncham@gmail.com>
[mono.git] / mcs / class / corlib / System.Runtime.Remoting / ObjRef.cs
index 30234367827314cbfaa1b837eebdc0ec1ef83232..ad2fde125b27799abe3685ae6dc5ff22989282a0 100644 (file)
@@ -39,6 +39,10 @@ using System.Runtime.Remoting.Channels;
 using System.Runtime.Remoting.Messaging;
 using System.Runtime.Remoting.Proxies;
 
+#if NET_2_0
+using System.Runtime.ConstrainedExecution;
+#endif
+
 namespace System.Runtime.Remoting {
 
        [Serializable]
@@ -92,7 +96,7 @@ namespace System.Runtime.Remoting {
                        uri = RemotingServices.GetObjectUri(mbr);
                        typeInfo = new TypeInfo(type);
 
-                       if (!type.IsAssignableFrom (mbr.GetType()))
+                       if (!type.IsInstanceOfType (mbr))
                                throw new RemotingException ("The server object type cannot be cast to the requested type " + type.FullName + ".");
 
                        UpdateChannelInfo();
@@ -166,7 +170,9 @@ namespace System.Runtime.Remoting {
                }
 
                public virtual IChannelInfo ChannelInfo {
-
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                        get {
                                return channel_info;
                        }
@@ -229,6 +235,9 @@ namespace System.Runtime.Remoting {
                        return identity.IsFromThisAppDomain;
                }
 
+#if NET_2_0
+               [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)]
+#endif
                public bool IsFromThisProcess ()
                {
                        foreach (object data in channel_info.ChannelData)