Castle Windsor - Register compoents before my Facilities load. - Delay loading configuration file?
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.Regist开发者_C百科er(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!
container.Install(Configuration.FromAppConfig());
See the documentation.
精彩评论