How Do I get the current instance from an AppDomain?

Posted by Spanners on Stack Overflow See other posts from Stack Overflow or by Spanners
Published on 2010-05-11T16:39:56Z Indexed on 2010/05/11 16:44 UTC
Read the original article Hit count: 264

Filed under:
|
|
|
|

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?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about 3.5