开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜