I want to run a third party library (XSP in this instance) inside an app domain so I can shut it down and otherwise control its behavior.
The basic process of:
var child = AppDomain.CreateDomain(...)
...
AppDomain.Unload(child)
Doesn't work when the child app domain creates an app domain itself. When I shut down 'child', any app domains it has created still persist.
I'd like to be able to say 'unload this and everything inside it' or detect when an app domain creates a new app domain so I can add it to a list of things to clean up.
Are there APIs to support either of these approaches?
Is there another way to achieve the same thing without spawning OS processes?