MVC4控制器和服务 [英] MVC4 Controllers and Services

查看:88
本文介绍了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 :)


这篇关于MVC4控制器和服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆