in code i can do some thing like this:
container.Register(AllTypes.FromAssemblyNamed("AssemblyName"));
can i do the same thing using Configuration file "Windsor.Config"???
Responding to your comment.
There's also a 3rd way (in Windsor 2.5, currently in beta 2 - final release is expected very soon).
You can have each of your modules reference Windsor, and each module have its own set of Installers.
Than you can use the new directory scanning capability to install components from all these assemblies:
// In your root assembly
var container = new WindsorContainer();
container.Install(
FromAssembly.This(),
FromAssembly.InDirectory(new AssemblyFilter("Modules")),
Configuration.FromAppConfig()
)
In addition if you have components following identical structure you can also register components from multiple assemblies in single installer. See more here.
container.Register(
AllTypes.FromAssemblyInDirectory(new AssemblyFilter("Modules"))
.Where(t=>t.Namespace.EndsWith(".Services"))
.WithService.DefaultInterface()
);
I am pretty sure that only with the fluent configuration API can you set up conventions for your application so that as you create new components you aren’t required to register them individually, as you example shows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With