The magic seems to be in a special TransparentProxy class – the .NET Runtime handles it in a special way.
- If you want to use it, see an article about RealProxy
- If you want to read more about the “magic”, see an article on TransparentProxy implementation.
- For a basic overview, try the MSDN article “Remoting: A Technical Overview”.
I think that MarshalByRefObject may contain some additional internal information which can be helpful for this mechanism, but I haven’t looked much into that.