This project is read-only.

[Serializable] and MarshalByRefObject on ActivatorHost

Jun 26, 2014 at 9:07 PM
I wonder why ActivatorHost needs to be marked as [Serializable]. Isn't deriving from MarshalByRefObject enough to send the ref across the AppDomain?
Jun 26, 2014 at 9:15 PM
You're right, you don't need [Serializable] if it's designated as a MarshalByRefObject, so it's basically redundant here.
Jun 26, 2014 at 9:33 PM
Ok so its not something I was missing :) Does the same hold true for the Activator class as well?
Jun 27, 2014 at 6:10 PM
Yeah, it holds for Activator as well. Any time you're pointing to a reference rather than serializing/deserializing a value, only MarshalByRefObject is needed, otherwise, only [Serializable] is needed