Deploying a non-serializable class from an application

Because not all classes used in the class that I want to create are serializable, I cannot deploy.

Is it possible?

var appdom = AppDomain.CreateDomain(amServiceable.GetType().ToString()); var objectHandle = appdom.CreateInstance(amServiceable.GetType().Assembly.FullName, amServiceable.GetType().FullName); var plugin = objectHandle.Unwrap() as IPlugin //throws an error. that some class in not marked serializable. 
+4
source share
1 answer

To use the Unwrap method for an object, it must be obtained from MarshalByRefObject . If the object you want to manipulate is not the only other choice, use another MarshalByRefObject to control the object in another domain.

+5
source

All Articles