How Do I get the current instance from an AppDomain?
- by Spanners
Hi,
I use the default appdomain (AD) which I use to create new appdomains (AD1) when required for running plugins in isolation.
When creating the new domain I also wire up the AppDomainUnload event to allow me to call clean up code etc.
The issue I seem to have is:
1) Create AD1 from AD
2) Run code in AD1
3) Call AD.Unload(AD1)
The code switches to AD1 and calls the unloading event passing in a reference to the current AppDomain (AD1).
At this point I'd like to get a reference to the current instance running in AD1 to call a shutdown method however there is no GetInstance on the AppDomain class.
Any ideas how I can go about getting it?