[Serializable] and MarshalByRefObject on ActivatorHost

Developer
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?
Coordinator
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.
Developer
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?
Coordinator
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