我试图使用@ Html.Action(“ActionName”,“controllerName”)从我的视图中调用一个Action.但我的页面无法加载以下错误: A single instance of controller ‘Ki_PathwaysWeb.Areas.LearningManager.Controllers.ActionCon
A single instance of controller ‘Ki_PathwaysWeb.Areas.LearningManager.Controllers.ActionController’
cannot be used to handle multiple requests. If a custom controller
factory is in use, make sure that it creates a new instance of the
controller for each request.
我正在使用结构图进行依赖注入.请帮帮我,我错过了什么.
你需要添加x.For< {Your controller name}>().AlwaysUnique();
在IoC.cs文件中.应该为项目中的每个控制器执行此操作.
有关详细信息,请查看this link.