I'm using unity 1.1 version and i couldn't inject constructor. My code sush as:
Registering dependencies in global.asax Application_Startup method:
Core.Instance.Container.RegisterType<ICartBusiness, CartBusiness>();
Injecting constructor:
private ICartBusiness _business;
public FooController(ICartBusiness business)
{ _business = business; }
mvc throwing this exception:
No parameterless constructor defined for this object.
P.S: i can't use any new version of unity because i'm using too referenced old dlls so i can't use unity.WebApi or unity.Mvc3 dlls.
How to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…