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
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?
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
Hi Marc
Unfortunately thats not the case at least for this class - its a wrap around ConfigurationManager (system.configuration)
Regards Henrik Farnø
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ø
Hi
Problem solved - I added this attribute to the failing dependencies: [RuntimeLevel(MaxLevel = RuntimeLevel.Run)]
is working on a reply...