'args.PageContext'引发了'System.InvalidOperationException'类型的异常

时间:2019-05-23 00:09:37

标签: sitecore sitecore-mvc sitecore9

我的自定义Sitecore管道处理器出现错误

  

'args.PageContext'引发了类型异常   'System.InvalidOperationException'

我的处理器在Sitecore.Mvc.Pipelines.Request.RequestBegin.SetupPageContext处理器之前执行。

[InvalidOperationException: Attempt to retrieve context object of type 'Sitecore.Mvc.Presentation.PageContext' from empty stack.]
   Sitecore.Mvc.Common.ContextService.Peek() +259
   Sitecore.Mvc.Pipelines.MvcPipelineArgs.get_PageContext() +23
   Sitecore.Mvc.Pipelines.Request.CreateController.CreateItemController.CreateController(CreateControllerArgs args) +25
   Sitecore.Mvc.Pipelines.Request.CreateController.CreateItemController.Process(CreateControllerArgs args) +63
   (Object , Object ) +14
   Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236
   Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args) +195
   Sitecore.Mvc.Pipelines.PipelineService.RunPipeline(String pipelineName, TArgs args, Func`2 resultGetter) +161
   Sitecore.Mvc.Controllers.SitecoreControllerFactory.CreateSitecoreController(RequestContext requestContext, String controllerName) +221
   Sitecore.Mvc.Controllers.SitecoreControllerFactory.CreateController(RequestContext requestContext, String controllerName) +95

[ControllerCreationException: Could not create controller: 'Sitecore'. ]
   Sitecore.Mvc.Controllers.SitecoreControllerFactory.CreateController(RequestContext requestContext, String controllerName) +171
   System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +263
   System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +77
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +1122
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +131

0 个答案:

没有答案