Windsor castle cannot Resolve any type after registering them by Assembly
I am trying implement a service that scans the current library for all '.ddl' extension and then registering them by Assembly in Castle Windsor, but when i try to resolve An exception is thrown with the message : 'No component for supporting the service'. If i iterate through Kernel.GetAssignableHandlers i can see that all types are registered.
1. get the assembly root name:
var delimiterIndex = assembly.FullName.IndexOfAny(new[] { '.' });
2. Get all the Assemblies as an Array
return Directory.EnumerateFiles(AppDomain.CurrentDomain.BaseDirectory, "*.*", SearchOption.AllDirectories)
.Where(x => Path.GetExtension(x).Equals(".dll", StringComparison.InvariantCultureIgnoreCase))
.Where(x => Path.GetFileName(x)
.StartsWith(rootAssemblyName, StringComparison.InvariantCultureIgnoreCase)).Select(Assembly.LoadFile).ToArray();
3. Register each Assembly in Windsor Castle Container
Classes.FromAssembly(assembly).Pick().WithServiceBase().WithServiceAllInterfaces().WithServiceSelf().LifestyleTransient()
4. Resolve
var instance = _container.Resolve<IFoo>();
When Resolving 'ComponentNotFoundException' is thrown with the message:
'No component for supporting the service Mes.Utils.DBUpgrade.IDBUpgrader was found'
IDBUpgrader
which isn't registered? Are you able to resolve other types from the assembly? – Scott Hannen