castle windsor学习-----Fluent Registration API 注册

使用xml配置和fluent注册两种搭配使用需要注意的是:

如果先在WindsorContainer构造函数指明用xml配置进行注册,如下设置

IWindsorContainer container = new WindsorContainer("dependencies.config");

container.Register(
    Component.For....
);

如果先用fluent注册,则如下设置

container.Register(
    Component.For....
);

container.Install(
    Configuration.FromXmlFile("dependencies.config"));

 

posted @ 2017-03-11 01:29  蓝平凡  阅读(395)  评论(0编辑  收藏  举报