locked
Using AppDomains to load and unload dlls RRS feed

  • Question

  •  

    Hi,

     

    I'm in the begging of designing a plugins mechanism. Since I have to support loading and unloading of dlls during the application runtime, I found no other solutation rather than using seperate AppDomains for each dll. So i have the following questions:

     

    1. Is there a limit to the number of active appDomains?

    2. Is there a significant cost for holding tens of AppDomains at runtime?

    3. Is there a better way supporting such feature?

     

    Thanks!

     

     

     

    Wednesday, April 23, 2008 8:31 AM

Answers

  • There is no well-defined limit of how many AppDomains you can have.  Obviously the number is not infinite because an AppDomain is associated with some resources, but you can certainly afford tens of AppDomains simultaneously.

     

    What you've described is the classical way of dealing with dynamic loading and unloading of DLLs.  You might find the System.AddIn framework present in .NET 3.5 useful to save you some of the development costs.

     

    Wednesday, April 23, 2008 10:37 AM

All replies

  • There is no well-defined limit of how many AppDomains you can have.  Obviously the number is not infinite because an AppDomain is associated with some resources, but you can certainly afford tens of AppDomains simultaneously.

     

    What you've described is the classical way of dealing with dynamic loading and unloading of DLLs.  You might find the System.AddIn framework present in .NET 3.5 useful to save you some of the development costs.

     

    Wednesday, April 23, 2008 10:37 AM
  • Unfortunately I must support 2.0 Framework clients, but thanks - You answered my questions!

    Wednesday, April 23, 2008 12:35 PM