We create a .NET application where we load external code assemblies ("plugins"). Until that moment, we downloaded these assemblies into one (main) application domain.
We would like to be able to unload the assembly after loading it.
To this end, we are developing a system that will create a separate additional AppDomain to host plugin builders that will be unloaded at will.
The problems we have with this approach are:
- The plug-in DLL module should interact with classes in the main AppDomain (for example, logger).
- Data that is sent to the plugin dll is not necessarily marked as Serializable or retrieved from MarshalByRefObj.
Is there any common practice of splitting an application in such cases? What is the best decision we could take?
Another interesting question: why does MarshalByRef not follow the attribute and force us to deduce from the object?
source
share