We are using unity as IoC. We came across unique problem. We have created interface called IPlugin. This interface is shared across various third party vendors to develop th
var assemblies = Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory, "Worker*.dll").Select(f => Assembly.LoadFile(f)).ToArray();
(from asm in assemblies
from t in asm.GetExportedTypes()
where typeof(ICommonWorker).IsAssignableFrom(t) && t.IsClass
select t).ForEach(x =>
{
unityContainer.RegisterType(typeof(ICommonWorker), x, x.FullName, new ContainerControlledLifetimeManager());
});
If anyone still cares, this is what I did to load DLL's dynamically which implemented a specific interface (ICommonWorker).