From 83c99b05f390f396191037aed25326551bf7fede Mon Sep 17 00:00:00 2001 From: Mirko Sekulic Date: Wed, 22 Jan 2025 12:43:16 +0100 Subject: [PATCH] move registration of applciation insights before Scrutor Decorate call --- backend/src/Designer/Program.cs | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/backend/src/Designer/Program.cs b/backend/src/Designer/Program.cs index cd668a551f4..12d9023941b 100644 --- a/backend/src/Designer/Program.cs +++ b/backend/src/Designer/Program.cs @@ -197,25 +197,6 @@ void ConfigureServices(IServiceCollection services, IConfiguration configuration services.AddMaskinportenHttpClient("MaskinportenHttpClient", maskinportenSettings); - services.RegisterServiceImplementations(configuration); - - services.AddHttpContextAccessor(); - services.AddMemoryCache(); - services.AddResponseCompression(); - services.AddHealthChecks().AddCheck("designer_health_check"); - - CreateDirectory(configuration); - - services.ConfigureDataProtection(configuration, logger); - services.ConfigureMvc(); - services.ConfigureNonMarkedSettings(configuration); - - services.RegisterTypedHttpClients(configuration); - services.AddAnsattPortenAuthenticationAndAuthorization(configuration); - services.ConfigureAuthentication(configuration, env); - - services.Configure(configuration.GetSection("CacheSettings")); - // Add application insight telemetry if (!string.IsNullOrEmpty(applicationInsightsConnectionString)) { @@ -235,6 +216,25 @@ void ConfigureServices(IServiceCollection services, IConfiguration configuration services.AddSingleton(); } + services.RegisterServiceImplementations(configuration); + + services.AddHttpContextAccessor(); + services.AddMemoryCache(); + services.AddResponseCompression(); + services.AddHealthChecks().AddCheck("designer_health_check"); + + CreateDirectory(configuration); + + services.ConfigureDataProtection(configuration, logger); + services.ConfigureMvc(); + services.ConfigureNonMarkedSettings(configuration); + + services.RegisterTypedHttpClients(configuration); + services.AddAnsattPortenAuthenticationAndAuthorization(configuration); + services.ConfigureAuthentication(configuration, env); + + services.Configure(configuration.GetSection("CacheSettings")); + services.AddLocalization(options => options.ResourcesPath = "Resources"); services.ConfigureLocalization();