【发布时间】:2009-11-22 07:17:14
【问题描述】:
配置:
component id="customerService" service="MyApp.ServiceLayer.ICustomerService`1[[MyApp.DataAccess.Customer, MyApp.DataAccess]], MyApp.ServiceLayer" type="MyApp.ServiceLayer.CustomerService, MyApp.ServiceLayer"
控制器:
private ICustomerService _service;
public CustomerController()
{
WindsorContainer container = new WindsorContainer(new XmlInterpreter());
_service = container.Resolve>("customerService");
}
服务层:
private ICustomerRepository _repository;
public CustomerService(ICustomerRepository repository)
{
_repository = repository;
}
错误:
无法创建组件“customerService”,因为它需要满足依赖关系。 customerService 正在等待以下依赖项: 服务: - MyApp.Repository.ICustomerRepository`1[[MyApp.DataAccess.Customer, MyApp.DataAccess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] 未注册。【问题讨论】:
标签: castle-windsor