This project has moved and is read-only. For the latest updates, please go here.

Loading referenced assemblies

Nov 26, 2010 at 8:34 AM


I am loading assemblies using MEF and DirectoryCatalog. This works fine but when I try to use referenced assemblies from within this loaded assembly it turns out that these have to be present in the main directory. The system is planned to be an empty container deployed in the main directory and then dynamically load plugins from subdirectories. But these plugins is composed of one main plugin assembly and other helper assemblies (eg data access layer components) that is referenced from the main plugin assembly. Everything works fine if I put only the main plugin assembly in the subdirectory and the referenced assemblies in the main directory but that is not how I want the system to be deployed. Is there any way to load the referenced assemblies from the subdirectory?

Thankful for any help and suggestions!

Nov 29, 2010 at 11:12 PM

See the "Assembly load issues" section of this blog post, and the Best Practices for Assembly Loading MSDN document for information about assembly loading that will hopefully help you resolve this issue.