What's the easiest way of programatically listing registered types in Castle Windsor?
Thanks
Castle Windsor is a best of breed, mature Inversion of Control container available for . NET and Silverlight. The current version is 5.0, released in February 2019. Refer to the links on the right to download it from GitHub or NuGet.
Castle Windsor is Dependency Injection container. It means with the help of this you can inject your dependencies and use them without creating them with the help of new keyword.
Use IKernel.GetAssignableHandlers(typeof(object))
:
IWindsorContainer container = ...
foreach (var handler in container.Kernel.GetAssignableHandlers(typeof(object))) {
Console.WriteLine("{0} {1}",
handler.ComponentModel.Service,
handler.ComponentModel.Implementation);
}
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