📜 ⬆️ ⬇️

We make shipped assemblies: we interact between domains without marshalling



Link to the project in GitHub: DotNetEx

On multiple resources, a question is asked from time to time. Is it possible to make shipped assemblies from the current domain? So, to use and "come on, bye!"? Everywhere and always the answer that was given is “no”. After all, the only thing that can be unloaded is the domain. Accordingly, if you want to organize the shipment, the assembly must be placed in the domain, and the interaction between the domains through serializable types should be established. And this is a very slow interaction. And we say so. Can. With nuances. We will also upload to a separate domain. But we will cancel serialization when calling methods between domains .
')
Questions that we will solve:


Solution to the problem


So, as always, we will solve problems as they appear:


findings


As they say, you cannot make shipped types, but if you want, you can. You just need to somehow pass between the domains a pointer to the object and they can be used on equal terms.
There is only one minus of the method: we have no right to use objects after unloading the assembly. This is a minus for one simple reason: it is necessary to additionally control the order of shipment and the loss of references to objects. But, in general, this is not a problem =)

Source: https://habr.com/ru/post/247491/


All Articles