Copied to clipboard

Flag this post as spam?

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


  • James Mangubat 2 posts 84 karma points
    Jun 25, 2019 @ 14:22
    James Mangubat
    1

    No factory has been set.

    Hello! I'm new to Umbraco. When a project is ran, we encountered an error: "Exception Details: System.InvalidOperationException: No factory has been set."

    Stack Trace:

    [InvalidOperationException: No factory has been set.] Umbraco.Core.Composing.Current.get_Factory() +86 Umbraco.Web.Composing.ModuleInjector`1.Init(HttpApplication context) +325 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +584 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +277 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369

    [HttpException (0x80004005): No factory has been set.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +724

    Any clue how this can be resolved please? Any help would be appreciated.

  • mrosiak 3 posts 97 karma points
    Jun 25, 2019 @ 18:46
    mrosiak
    103

    Did you replace Global.asax? It happened to me when I copied my Global.asax from previous Umbraco 7 didn't realise the approach to invoking code on application start has been completely changed. Check this link from umbraco docs here

  • James Mangubat 2 posts 84 karma points
    Jun 26, 2019 @ 03:19
    James Mangubat
    1

    Thank you! Yes. After I made global.asax available again in the project. That specific error went away. Now another issue came in but is now superficial and clearer in detail.

  • Rakesh 11 posts 91 karma points
    May 13, 2020 @ 08:01
    Rakesh
    0

    Hi James, Even am getting the same error post installing the necessary packages. However i got a pop up stating do you want to replace Global.asax i said no so that i will retain mine as it is. Still am getting this error . Please let me know on this if you have any idea/observations while you were fixing this issue.

  • Rakesh 11 posts 91 karma points
    May 22, 2020 @ 12:51
    Rakesh
    0

    It will be great helpful if any one can help me out in resolving this issue. Am still facing same issue.

  • Jack Lawry 23 posts 146 karma points c-trib
    Sep 13, 2021 @ 11:45
    Jack Lawry
    0

    I just found this post having got the same error and fixed it by checking:

    • Permissions of the files on the server - check you have allowed the IIS user access to the site files.
    • Connection string - Check the connection string is correct.

    Hopefully this helps someone.

  • Jan Reilink 5 posts 25 karma points
    Oct 21, 2021 @ 13:27
    Jan Reilink
    0

    I can confirm wrong directory and file permissions can be the cause of this error.

    In my situation, I wanted to create a staging environment by:

    • copying the webroot to a staging folder
    • created a new IIS site and appPool
    • restoring the SQL database back-up into a new back-up
    • adjusting the connection string in web.config

    This gave an error:

    Exception Details: System.InvalidOperationException: No factory has been set.

    Setting correct file permissions to my staging folder resolved this.

  • Christian Fredh 2 posts 22 karma points
    Jul 26, 2022 @ 08:51
    Christian Fredh
    0

    For me, it turned out I had an old setting left in umbracoSettings.config:

      <useDomainPrefixes>false</useDomainPrefixes>
    

    I removed it and I got rid of the error. "No factory has been set." is a cryptic error message but I did find the cause after checking the logs:

    Umbraco.Core.Exceptions.BootFailedException: Boot failed. ---> System.Configuration.ConfigurationErrorsException: Unrecognized element 'useDomainPrefixes'.
    

    So check if you have this setting. And if not, the logs might give you direction to other settings or issues.

Please Sign in or register to post replies

Write your reply to:

Draft