Error Rendering Controller: EventIntro. Action: Index: An unhandled exception occurred

Hello,

Acually Im following the Sitecore Essentials for Developer eLearning Student Lab.

 

I'm facing a problem at step Module 3 -> Lab: Creating a Component.

I did all the steps(creating EventController, views) but When previewing a page I get :

Error Rendering Controller: EventIntro. Action: Index: An unhandled exception occurred.

At this place:

<!-- [Event Info] -->
@Html.Sitecore().Rendering("/sitecore/layout/Renderings/TAC/Events/EventIntro")
<!-- [/Event Info] -->

Here is the full trace: 

 at Sitecore.Mvc.Pipelines.MvcEvents.Exception.ShowAspNetErrorMessage.ShowErrorMessage(ExceptionContext exceptionContext, ExceptionArgs args)
   at Sitecore.Mvc.Pipelines.MvcEvents.Exception.ShowAspNetErrorMessage.Process(ExceptionArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
   at Sitecore.Mvc.Pipelines.PipelineService.RunPipeline[TArgs](String pipelineName, TArgs args)
   at Sitecore.Mvc.Filters.PipelineBasedRequestFilter.OnException(ExceptionContext exceptionContext)
   at System.Web.Mvc.ControllerActionInvoker.InvokeExceptionFilters(ControllerContext controllerContext, IList`1 filters, Exception exception)
   at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
   at System.Web.Mvc.Controller.ExecuteCore()
   at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext)
   at Sitecore.Mvc.Controllers.ControllerRunner.ExecuteController(Controller controller)
   at Sitecore.Mvc.Controllers.ControllerRunner.Execute()
   at Sitecore.Mvc.Presentation.ControllerRenderer.Render(TextWriter writer)
   at Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args)

 

Thank you for your help

 

Saad

  • I am getting the same error. I will let you know if I can find the fix for it.
  • Can you try this and see if it works
    @Html.Sitecore().ControllerRendering("controller_name", "action_name")

  • Make sure the View can be reached.
    When scaffolding the controller it's supposed to be under
    ~/Views/EventIntro/Index.cshtml
  • Ensure that below configurations are done correctly:

    1. In the controller rendering, you have entered the controller name and action method name in correct fields.
    2. The controller rendering is published.
    3. You've given the correct view path in controller method. Something like "return view("`/controller/mysite/myview")".
    4. Your solution is built and the dll containing the controller class is available in bin folder.
  • I had the same issue. For me it was resolved by adding the full path to the Controller filed in the EventIntro Controller Rendering Item. So replacing EventIntro with events.tac.local.Controllers.EventInfoController, events.tac.local