diff --git a/Src/Dnn/ToSic.Sxc.Dnn.Main/DnnBusinessController.cs b/Src/Dnn/ToSic.Sxc.Dnn.Main/DnnBusinessController.cs index 3a9aca5015..b3dec607be 100644 --- a/Src/Dnn/ToSic.Sxc.Dnn.Main/DnnBusinessController.cs +++ b/Src/Dnn/ToSic.Sxc.Dnn.Main/DnnBusinessController.cs @@ -4,8 +4,12 @@ // Note about the name // Some day we should change this namespace to ToSic.Sxc.Dnn.something // But we can't just do it, because the name is registered in Dnn DBs, so update-scripts would be needed -// TODO: STV - WHY IS THIS NOT PART OF THE DnnBusinessController? it seems that that is already the term in the DB? - +// WHY IS THIS NOT PART OF THE DnnBusinessController? it seems that that is already the term in the DB? +// Reason if that can't call StartupDnn().Configure() from ToSic.Sxc.Dnn.DnnBusinessController because of circular dependency +// and need to configure DI before UpgradeModule to fix issue: "Module upgrade did not complete." +// "System.ArgumentNullException: Value cannot be null. Parameter name: provider +// at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) +// at ToSic.Eav.Factory.GetServiceProvider()" // ReSharper disable once CheckNamespace namespace ToSic.SexyContent { @@ -13,8 +17,8 @@ public class DnnBusinessController: ToSic.Sxc.Dnn.DnnBusinessController, IUpgrad { public new string UpgradeModule(string version) { - new StartupDnn().Configure(); + new StartupDnn().Configure(); // can't call it from ToSic.Sxc.Dnn.DnnBusinessController because of circular dependency return base.UpgradeModule(version); } } -} \ No newline at end of file +}