views:

27

answers:

3

Hi all, I'm writing a plugin system: every plugin is in his own assembly that must be loaded by autofac and is signed by an attribute with a parameter that set the type of plugin. I would be able to resolve in my asp.net mvc app the plugins by type, how can I do this? Every plugin inhrerit by an abstract class and override predefinited methods.

+1  A: 

Personally I would use MEF for this and use Autofac's MEF integration.

OJ
why would you use mef? i don't know if i'm wrong but could i use autofac metadata or maybe named/keyed feature?
Stefano
A: 

Create a Autofac.Module in every plugin assembly. Register your plugin stuff there, and from your main application load your plugin dlls, look for Modules, register in container. Then resolve and have fun ;).

ppiotrowicz