The memory between AppDomain's is not shared. By default the objects are a deep clone, if they are MarshalByRef then its similar to remoting where the calls are executed across AppDomain, so it appears that its shared state.
MarshalByRefObject
is the base class for objects that communicate across application domain boundaries by exchanging messages using a proxy. Objects that do not inherit from MarshalByRefObject
are implicitly marshal by value. When a remote application references a marshal by value object, a copy of the object is passed across application domain boundaries.
I don't believe you can actually invoke static members using the AppDomain methods, your best bet would be to wrap the static calls in an instance class and use DoCallback
to execute that code in the other domain and collect the state in a MarshalByRef
object.
See the example on MSDN
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…