I am trying to following book : Pro ASP.NET MVC Framework by Steven Sanderson...
The line container = new WindsorContainer(xi);
produces this error:
Could not convert from 'DomainModel.Abstract.IPeopleRepository, DomainModel' to System.Type - Maybe type could not be found**
public WindsorControllerFactory()
{
ConfigResource confres = new ConfigResource("castle");
XmlInterpreter xi = new XmlInterpreter(confres);
container = new WindsorContainer(xi);
// Also register all the controller types as transient
var controllerTypes = from t in Assembly.GetExecutingAssembly().GetTypes()
where typeof(IController).IsAssignableFrom(t)
select t;
foreach (Type t in controllerTypes)
{
container.AddComponentLifeStyle(t.FullName, t, LifestyleType.Transient);
}
}
The castle config:
<castle>
<components>
<component id="PeopleRepository"
service="DomainModel.Abstract.IPeopleRepository, DomainModel"
type="DomainModel.Concrete.FakePeopleRepository, DomainModel"
>
How can this be fixed?