MVC4控制器和服务

MVC4控制器和服务

问题描述:

"None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'WebShopDesigns.Web.Controllers.CatalogController' can be invoked with the available services and parameters:"
Cannot resolve parameters.



你好,当我尝试在Controller中的constuctor中添加参数时,我遇到了上述错误。



请任何人可以提供帮助



先谢谢。


Hi I am getting above error when I try to add parameters in constuctor in Controller.

Pleas any one can help

Thanks in Advance.

尝试添加 StructureMap nuget package 进入你的项目。希望它有所帮助。并且确实了解依赖注入控制反转(IoC)



谢谢

快乐编码

享受SD:)
Try and add StructureMap from nuget package into your project.Hope it helps.and do get some idea about Dependency Injection and Inversion of Control(IoC)

Thank you
Happy Coding
Enjoy SD's :)