Get the DLL from the Windsor Castle directory

I currently have a "PlugInFolder" folder where I want to copy my custom plugin as a DLL. Each plugin implements my IPlugIn interface.

I want to get them at runtime with Windsor Castle.

I tried something like this to no avail:

CastleContainer.Instance .Install( FromAssembly.InDirectory(new AssemblyFilter("PlugInFolder")) ); CastleContainer.Instance.Register(Component.For<IPlugIn>()); IPlugIn[] plugIn= CastleContainer.Instance.ResolveAll<IPlugIn>(); 

I get this error:

 Type ImageEditorInterfaces.IPlugIn is abstract. As such, it is not possible to instansiate it as implementation of service ImageEditorInterfaces.IPlugIn. 
+6
source share
1 answer

Try something like this:

 container.Register(AllTypes .FromAssemblyInDirectory(new AssemblyFilter("PlugInFolder")) .BasedOn<IPlugIn>()); 
+6
source

Source: https://habr.com/ru/post/887751/


All Articles