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 addStructureMap
from nuget package into your project.Hope it helps.and do get some idea aboutDependency Injection
andInversion of Control(IoC)
Thank you
Happy Coding
Enjoy SD's :)