views:

19

answers:

1

Hi,

I would like to register some components in my Windsor container before my Facilities load - (so that I can use some the components in the facilities)

I was thinking there should be some way to initialize windsor without a configuration file, register some components, and only then load the configuration? - this would result in that my configured facilities would load only after I registered my components.

For example:

var container = new WindsorContainer();

//Register a custom component, which will be used in some of the facilities
container.Register(Component.For<IMyService>().ImplementedBy<MyService>());

//Now load via the configuration - unfortunately the method "Configure" doesn't exist
container.Configure(new XmlInterpreter(new ConfigResource("castle")));

Appreciate any help on this,

Thanks!

A: 
container.Install(Configuration.FromAppConfig());

See the documentation.

Krzysztof Koźmic
Thanks, that was exactly what I wanted!
Bilsa