- if (realTarget != null && RemotingServices.IsTransparentProxy (realTarget)) {
- // The call to IsInstanceOfType will force the proxy
- // to load the real type of the remote object. This is
- // needed to make sure that subsequent calls to
- // GetType() return the expected type.
- Assembly tasm = Assembly.Load (targetTypeAssembly);
- Type tt = tasm.GetType (targetTypeName);
- if (!tt.IsInstanceOfType (realTarget))
- throw new RemotingException ("Unexpected proxy type.");
- }
+ if (RemotingServices.IsTransparentProxy (realTarget)) {
+ // The call to IsInstanceOfType will force the proxy
+ // to load the real type of the remote object. This is
+ // needed to make sure that subsequent calls to
+ // GetType() return the expected type.
+ Assembly tasm = Assembly.Load (targetTypeAssembly);
+ Type tt = tasm.GetType (targetTypeName);
+ if (!tt.IsInstanceOfType (realTarget))
+ throw new RemotingException ("Unexpected proxy type.");
+ }