Search code examples
c#marshallingsandboxappdomain

Performance of MarshalByRefObject Attribute in the same AppDomain


I need to add the MarshalByRefObject attribute to some classes (that define the interface of a plug-in) to allow sandboxing of these plug-ins. These classes are also used in a "non-plugin" context in a completely different application, but the attributes are in code. Do I will have any performance penalties in this other application without extra AppDomains?


Solution

  • You should have no major performance impact, if it is being called from the same AppDomain none of the methods of MarshalByRefObject will be called.

    If there was a major impact than WinForms would be in a lot of trouble considering Control derives from MarshalByRefObject