Types Catalog

Apr 28, 2009 at 8:08 AM
Hi there,

I'm considering Unity for a project, and I'd like to know if with Unity  for example I may add assemblies dynamically to the application folder, without the need of reference them in the project.

MEF can do that, you can declare a file system catalog that points to a folder, and if you add new assemblies there MEF will be able to use them; the problem is that I need an IoC container for my project and therefore MEF doesn't fit :(

Apr 30, 2009 at 7:11 AM
We don't have any explicit support for this. But there's nothing preventing you from writing the code either; just do a little reflection, walk over every assembly in the bin directory, and figure out which types to register for which assembly. You'll need some sort of config mechanism or attribute to decide which type to map to which interface.

The code to do this isn't that hard if you're familiar with the reflection APIs.