diff --git a/src/VirtoCommerce.Platform.Web/Extensions/ServiceCollectionExtensions.cs b/src/VirtoCommerce.Platform.Web/Extensions/ServiceCollectionExtensions.cs index 2d41c5a521..c3f98d4fdb 100644 --- a/src/VirtoCommerce.Platform.Web/Extensions/ServiceCollectionExtensions.cs +++ b/src/VirtoCommerce.Platform.Web/Extensions/ServiceCollectionExtensions.cs @@ -40,7 +40,11 @@ public static IServiceCollection AddModules(this IServiceCollection services, IM // Ensure all modules are loaded ConsoleLog.BeginOperation("Registering API controllers"); - var modules = moduleCatalog.Modules.OfType().Where(x => x.State == ModuleState.NotStarted).ToArray(); + var notStartedModules = moduleCatalog.Modules.Where(x => x.State == ModuleState.NotStarted); + var modules = moduleCatalog.CompleteListWithDependencies(notStartedModules) + .OfType() + .ToArray(); + for (var i = 0; i < modules.Length; i++) { var module = modules[i];