You don't have to keep all configuration in a single file. Includes allow you to refer to configuration in other places.
All you need to do is specify an include node with the Uri that will be used to create the proper
. For example, the following will use the
The file is relative to the configuration file that has the include:
The next one uses an assembly resource:
The next one will use an section inside the configuration associated with the container.
Note that you must include the section declaration, like the following:
type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor" />
The next one will use a file in a network share
You can use multiple includes. Just have in mind that the id cannot repeat. If it does, the last registered id for the facility or for the component will be used and the previous will be discarded without warning or exceptions being thrown.
Any properties that are referenced within an include file must be above the include element like so:
If you reverse the order and put the include node above any properties that it references, you will get the following exception:
failed: Castle.Windsor.Configuration.Interpreters.XmlProcessor.ConfigurationProcessingException : Error processing node configuration, inner content ...
Castle.Windsor.Configuration.Interpreters.XmlProcessor.XmlProcessorException : Required configuration property Configuration.TimeoutDuration not found