Value cannot be null in sportstore exampe
- by Naim
Hi everyone,
I am having this problem when I want to implement IoC for sportstore example. The code
public WindsorControllerFactory(){
container = new WindsorContainer( new XmlInterpreter(new ConfigResource("castle"))
);
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);
}
protected override IController GetControllerInstance(Type controllerType)
{
return (IController)container.Resolve(controllerType);
}
}
The error said that the value cannot be null in the GetControllerInstance
Any help will be appreciated !
Thanks!
Naim