调用ASP.NET MVC控制器

时间:2017-09-20 16:56:02

标签: c# asp.net-mvc structuremap

我遇到了问题而且我很难过,所以我希望有人可以提供帮助。

看起来结构图在构建控制器时遇到了问题。我知道一切都是正确构建的,因为a)这已经生产多年了; b)当我得到错误时,我跟随的链接来自同一个控制器。

我无法在我的开发机器上重现这一点。谁能给我一些线索?

2017-09-19 08:00:45,231 [563] ERROR WebPortal.Global [(null)] - Object 
reference not set to an instance of an object.   at 
WebPortal.Controllers.EnrollmentController..ctor(ISystemUtility 
systemUtility, IObjectAdapter`2 userToCurrentUserViewModelAdapter, ILogger 
logger)
at lambda_method(Closure , IBuildSession , IContext )

2017-09-19 08:00:45,184 [563] ERROR WebPortal.Global [(null)] - Error while 
building type WebPortal.Controllers.EnrollmentController.  See the inner 
exception for details
1.) new EnrollmentController(*Default of ISystemUtility*, *Default of 
IObjectAdapter<User, CurrentUserViewModel>*, *Default of ILogger*)
2.) WebPortal.Controllers.EnrollmentController
3.) Instance of WebPortal.Controllers.EnrollmentController
4.) Container.GetInstance(WebPortal.Controllers.EnrollmentController)
at lambda_method(Closure , IBuildSession , IContext )
at StructureMap.Building.BuildPlan.Build(IBuildSession session, IContext 
context)
at StructureMap.SessionCache.GetObject(Type pluginType, Instance instance, 
ILifecycle lifecycle)
at StructureMap.SessionCache.GetDefault(Type pluginType, IPipelineGraph 
pipelineGraph)
at StructureMap.Container.GetInstance(Type pluginType)
at 
WebPortal.InjectableControllerFactory.GetControllerInstance(RequestContext 
requestContext, Type controllerType)
at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext 
requestContext, String controllerName)
at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, 
IController& controller, IControllerFactory& factory)
at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase 
httpContext, AsyncCallback callback, Object state)
at 
System.Web.HttpApplication.CallHandlerExecutionStep
.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& 
completedSynchronously)

0 个答案:

没有答案