Hello, I'm trying to deal with the add-in application. I want to make a small application on the plugins. Isolating each add-in to the new AppDomain. I load wpf-controls through:

FrameworkElementAdapters.ViewToContractAdapter FrameworkElementAdapters.ContractToViewAdapter 

but when AppDomain.unload () the memory is not unloaded (and when closing the application, the error falls: The final application domain is unloaded), probably somewhere there is a connection. If the plugin is done without wpf control, then everything is fine - the memory is unloaded and there are no errors when closing the application.

Question: how to load wpf controls from one AppDomain to another correctly?

PS: not using AddInStore from framework System.AddIn

    1 answer 1

    You not only will not be able to use controls from another domain, you will not even be able to use controls from another thread. It is impossible.

    It is strange that your application did not fall when trying to use the control from another domain.

    If you really need a separate domain (and most likely it is not), keep only the model in it, and the rest should be in the main domain. Or rather, load everything into one domain and use MEF or Prism instead of a bicycle.

    • msdn.microsoft.com/en-US/library/bb384200.aspx using MAF is possible, but I wanted to try without using AddInStore, everything works fine, but when the AppDomain is unloaded, the memory does not unload and the application crashes on closing the application - probably there was a connection somewhere - I wanted to understand why and how to fix it ... yes, reinventing the wheel is certainly not good, but it is better to understand it)) - Acne