tags:

views:

9

answers:

0

Hi, please help me with this issue. I have a singleton Class A in a DLL. In the create instance of class A, I call AppDomain.CreateDomain for another DLL that contains class B. This means that my Class A now has a reference to the AppDomain object. I use singleton Class A b/c my client app is a web app and I don't want to load/unload each time I need to access class B methods. Now, I need to do AppDomain.Unload for B when my app domain which Class A runs under is shut down. My Class A is hosted inside a WCF library so all I have at the time of shut down is a servicehost reference. How can do unload of an AppDomain created inside the WCF service when the servicehost is closing or is there a different better way to do this? My goal is not to have to load/unload the app domain on each call into class B. Thanks.