diff --git a/src/Umbraco.Web.Common/ModelsBuilder/DependencyInjection/UmbracoBuilderDependencyInjectionExtensions.cs b/src/Umbraco.Web.Common/ModelsBuilder/DependencyInjection/UmbracoBuilderDependencyInjectionExtensions.cs index 818e51aada..20cd35d0d1 100644 --- a/src/Umbraco.Web.Common/ModelsBuilder/DependencyInjection/UmbracoBuilderDependencyInjectionExtensions.cs +++ b/src/Umbraco.Web.Common/ModelsBuilder/DependencyInjection/UmbracoBuilderDependencyInjectionExtensions.cs @@ -114,8 +114,6 @@ public static class UmbracoBuilderDependencyInjectionExtensions builder.AddInMemoryModelsRazorEngine(); builder.AddNotificationHandler(); - builder.AddNotificationHandler(); - builder.AddNotificationHandler(); } if (builder.Config.GetRuntimeMode() != RuntimeMode.Production) @@ -128,12 +126,16 @@ public static class UmbracoBuilderDependencyInjectionExtensions builder.AddNotificationHandler(); builder.AddNotificationHandler(); builder.AddNotificationHandler(); + + builder.AddNotificationHandler(); + builder.AddNotificationHandler(); } builder.Services.TryAddSingleton(); // Register required services for ModelsBuilderDashboardController builder.Services.AddSingleton(); + // TODO: Remove in v13 - this is only here in case someone is already using this generator directly builder.Services.AddSingleton(); builder.Services.AddSingleton(); @@ -163,6 +165,7 @@ public static class UmbracoBuilderDependencyInjectionExtensions // This is what the community MB would replace, all of the above services are fine to be registered builder.Services.AddSingleton(factory => factory.CreateDefaultPublishedModelFactory()); + return builder; } }