Can anyone point me towards some good documentation / code examples on how best to manage the configuration of a DI container in a scenario where you need different configuations sets?
We have a layered, distributed application that has multiple entry points (ie; a website, winforms app, office plugin etc). Depending on how you are using the solution (through a UI vs. an automated workflow for example), it needs to be configured slightly differently.
We are using Windsor, and it’s fluent configuration capabilities.
You should have one container per application, so at that level you must configure each container for each application separately.
However, having a common base configuration for a family of applications is a normal requirement, and most DI Containers support that by providing a way in which you can package configurations.
In Castle Windsor, you do that by defining one or more classes that implement the IWindsorInstaller interface.
Example: