windsor = new WindsorContainer( new XmlInterpreter(new ConfigResource));
在配置文件的<configSections>配置节里首先加入下面的配置,关于这点的作用在此就不多解释,详细可以看看我之前写的文章:
<configSections>
<!-- Specify the castle section handler -->
<section name="castle" type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor"/>
上面我门定义了castle配置节点,那castle的配置节点该怎么去配置呢,看看下面的配置代码:
<castle>
<include uri="file://castle-dao.config"/>
</castle>
在castle-dao.config文件中
<configuration>
<components>
<component id="dao" service="dao" type="daoimpl">
</components>
</configuration>