CLR via C # book notes 6-2, the communication between the different AppDomain
|
FREE Diabetes Recipes eBook! Click here to redeem. |
There are two ways to cross-AppDomain communication
1.Marshal By reference: Passing by reference
2.Marshal By Value: the need to pass an object through deserialization serialization way to pass the last (value-copy)
Only marked as serializable Serializable class to pass the way communication Marshal By Value
The following code describes the case of several cross-domain communication
1.AppDomain is the internal behavior of CLR, windows are completely clear the existence of AppDomain
2. In the new Assembly and Type field loading is best to use the full qualified name (if the direct load Type, CLR will automatically load and the Type used in which the Assembly)
3. By default the new application domain to use and set the permissions as the current domain, if you need to manually specify the permissions, then the argument to construct a PermissionSet CreateDomain
4. Similarly, if you want to set different configuration application to construct a AppDomainSetup passed to him (you can set the configuration file, the program path, image copy of what ..)
5. Does not occur when cross-domain access to context switching of threads
6.CreateInstanceAndUnwrap default calling object constructor without argument, of course, some overloading allows you to call a parameterless constructor
7. Only an object can inherit System.MarshalByRefObject passed by reference (which is a base class …. c # do not allow multiple inheritance …. still very troublesome)
8. Only marked a Serializable object can be passed by value (the internal serialization deserialization), there are serious performance loss
Code
Sorry, the comment form is closed at this time.


Comments
No comments yet.