diff --git a/src/Umbraco.Web.Common/Extensions/ApplicationBuilderExtensions.cs b/src/Umbraco.Web.Common/Extensions/ApplicationBuilderExtensions.cs index fb12e979ab..efc95a59f7 100644 --- a/src/Umbraco.Web.Common/Extensions/ApplicationBuilderExtensions.cs +++ b/src/Umbraco.Web.Common/Extensions/ApplicationBuilderExtensions.cs @@ -27,10 +27,6 @@ namespace Umbraco.Extensions /// public static IUmbracoApplicationBuilder UseUmbraco(this IApplicationBuilder app) { - IOptions startupOptions = app.ApplicationServices.GetRequiredService>(); - - app.RunPrePipeline(startupOptions.Value); - // TODO: Should we do some checks like this to verify that the corresponding "Add" methods have been called for the // corresponding "Use" methods? // https://github.com/dotnet/aspnetcore/blob/b795ac3546eb3e2f47a01a64feb3020794ca33bb/src/Mvc/Mvc.Core/src/Builder/MvcApplicationBuilderExtensions.cs#L132 @@ -39,6 +35,9 @@ namespace Umbraco.Extensions throw new ArgumentNullException(nameof(app)); } + IOptions startupOptions = app.ApplicationServices.GetRequiredService>(); + app.RunPrePipeline(startupOptions.Value); + app.UseUmbracoCore(); app.UseUmbracoRequestLogging();