DigitalMomentum / MetaMomentum

An Umbraco Metadata Property Editor to manage Search engine results, open Graph and Twitter cards
9 stars 8 forks source link

Umbraco 8 update is broken by missing dependency #17

Open torerikk opened 1 year ago

torerikk commented 1 year ago

I've had two different Umbraco 8 projects fail on boot when I try to update to 8.18.6 them with Metamomentum 2.1.1 or 2.2.0 (the two versions I've tried). The inner most exception I get is this: System.InvalidOperationException: Unresolved dependency [Target Type: MetaMomentum.Core.ValueConverters.MetaMomentumValueConverter], [Parameter: metaMomentumConfig(MetaMomentum.Config.MetaMomentumConfig)], [Requested dependency: ServiceType:MetaMomentum.Config.MetaMomentumConfig, ServiceName:]

I think the issue is that MetaMomentumConfig is only registered for the Run runtime level and the MetaMomentumValueConverter is for some reason loaded during the upgrade and can't find the Config.

torerikk commented 1 year ago

This problem also applies to Umbraco 8.18.7. Adding a composer to my code that registers MetaMomentumConfig with a runtime level attribute set to upgrade ( [RuntimeLevel(MinLevel = RuntimeLevel.Upgrade)] ) fixes this problem.

dinc5150 commented 1 year ago

Thanks for the update @torerikk, looks like the project is trying to use the ValueConverter during the update. I can't see any issued in changing the RuntimeLevel if its required. I'll try and reproduce / test and get an update out for you.