Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jonathan Roberts 409 posts 1063 karma points
    Dec 08, 2022 @ 14:01
    Jonathan Roberts
    0

    Failed to create an instance of controller Error

    Hi, We are using version 8 of the CMS and we often get lots of these errors - any ideas what might be causing it?

     System.Exception: Failed to create an instance of controller type HE.Core.V8.Controllers.ArchiveController (see inner exception). ---> System.NullReferenceException: Object reference not set to an instance of an object.
       at Umbraco.Web.Runtime.WebInitialComposer.<>c.<Compose>b__0_6(IFactory factory) in D:\a\1\s\src\Umbraco.Web\Runtime\WebInitialComposer.cs:line 121
       at Umbraco.Core.FactoryExtensions.GetInstance[T](IFactory factory) in D:\a\1\s\src\Umbraco.Core\FactoryExtensions.cs:line 23
       at Umbraco.Web.Mvc.UmbracoController..ctor() in D:\a\1\s\src\Umbraco.Web\Mvc\UmbracoController.cs:line 76
       at Umbraco.Web.Mvc.RenderMvcController..ctor() in D:\a\1\s\src\Umbraco.Web\Mvc\RenderMvcController.cs:line 23
       at DynamicMethod(Object[] )
       at LightInject.PerRequestLifeTime.GetInstance(Func`1 createInstance, Scope scope) in C:\projects\lightinject\src\LightInject\LightInject.cs:line 6207
       at Umbraco.Web.Mvc.ContainerControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) in D:\a\1\s\src\Umbraco.Web\Mvc\ContainerControllerFactory.cs:line 21
       --- End of inner exception stack trace ---
       at Umbraco.Web.Mvc.ContainerControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) in D:\a\1\s\src\Umbraco.Web\Mvc\ContainerControllerFactory.cs:line 25
       at Umbraco.Web.Mvc.UmbracoControllerFactory.CreateController(RequestContext requestContext, String controllerName) in D:\a\1\s\src\Umbraco.Web\Mvc\UmbracoControllerFactory.cs:line 38
       at Umbraco.Web.Mvc.RenderControllerFactory.CreateController(RequestContext requestContext, String controllerName) in D:\a\1\s\src\Umbraco.Web\Mvc\RenderControllerFactory.cs:line 36
       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.ExecuteStepImpl(IExecutionStep step)
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    

    Thanks

  • Luuk Peters 85 posts 330 karma points
    Dec 08, 2022 @ 14:57
    Luuk Peters
    2

    It looks like a missing service in the DI container. Check if the services that get injected into the ArchiveController are all there. I've seen vague errors like these when it was not the ArchiveController itself which was the problem, but a service that was injected into the ArchiveController.

  • Nurhak Kaya 53 posts 147 karma points MVP 3x c-trib
    Dec 12, 2023 @ 16:06
    Nurhak Kaya
    0

    I have seen this problem today with a v8 project and I can confirm that it was due to a missing service in the DI container, just like Luuk Peters mentioned in their comment.

Please Sign in or register to post replies

Write your reply to:

Draft