Copied to clipboard

Flag this post as spam?

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


  • svinoe2105 4 posts 24 karma points
    Jun 21, 2022 @ 07:57
    svinoe2105
    0

    lightinject fails after upgrade

    Hi

    I have upgraded Umbraco from 8.11.1 to 8.18.4. I have cleaned every project - deleted temp files etc. But lightinject / dependency lookup keeps failing . The place where it fails is pretty trivial - its an injection of a class wrapping some helper methods for ConfigurationManager

    Does anybody have an idea what to do next?

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Jun 21, 2022 @ 08:06
    Marc Goodson
    0

    Hi svinoe2105

    Bit of a guess, but does the injected class 'wrap' UmbracoHelper or UmbracoContext??

    If so it might be that there is no guarantee of a Context being available if you are outside of a Http Request...

    ... if that is the case...

    Then you'd need to inject UmbracoContextFactory and use EnsureUmbracoContext:

    some info here:

    https://our.umbraco.com/Documentation/Implementation/Services/index-v8#accessing-published-content-outside-of-a-http-request

    But apologies if you are already doing this!

    Have just seen this be the issue before for people.

    regards

    Marc

  • svinoe2105 4 posts 24 karma points
    Jun 21, 2022 @ 08:29
    svinoe2105
    0

    Hi Marc

    Unfortunately thats not the case at least for this class - its a wrap around ConfigurationManager (system.configuration)

    Regards Henrik Farnø

  • svinoe2105 4 posts 24 karma points
    Jun 22, 2022 @ 14:24
    svinoe2105
    0

    Hi

    I have an update. I am able to reproduce this in an upgrade from 8.11.1 to 8.11.2 . First I did the nuget upgrade and it failed with the same error

    I then manually updated the umbraco.dlls to 8.11.2. and added the 2 updated dlls. Angel.css and HtmlSanitizer and the same result occurs

    Regards

    Henrik Farnø

  • svinoe2105 4 posts 24 karma points
    Jun 22, 2022 @ 16:08
    svinoe2105
    0

    Hi

    Problem solved - I added this attribute to the failing dependencies: [RuntimeLevel(MaxLevel = RuntimeLevel.Run)]

Please Sign in or register to post replies

Write your reply to:

Draft