diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpAspNetCoreComponentsWebModule.cs b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpAspNetCoreComponentsWebModule.cs index 50248d42ab..193224ae65 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpAspNetCoreComponentsWebModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpAspNetCoreComponentsWebModule.cs @@ -1,11 +1,8 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Volo.Abp.AspNetCore.Components.DependencyInjection; -using Volo.Abp.AspNetCore.Components.Web.Security; using Volo.Abp.Modularity; -using Volo.Abp.Threading; using Volo.Abp.UI; namespace Volo.Abp.AspNetCore.Components.Web; @@ -16,23 +13,8 @@ namespace Volo.Abp.AspNetCore.Components.Web; )] public class AbpAspNetCoreComponentsWebModule : AbpModule { - public override void PreConfigureServices(ServiceConfigurationContext context) - { - - } - public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.Replace(ServiceDescriptor.Transient()); } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - AsyncHelper.RunSync(() => OnApplicationInitializationAsync(context)); - } - - public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) - { - await context.ServiceProvider.GetRequiredService().InitializeAsync(); - } } diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs index 5473213bee..33716d8383 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Volo.Abp.AspNetCore.Components.Web; using Volo.Abp.AspNetCore.Components.Web.ExceptionHandling; +using Volo.Abp.AspNetCore.Components.Web.Security; using Volo.Abp.AspNetCore.Mvc.Client; using Volo.Abp.Http.Client; using Volo.Abp.Modularity; @@ -46,6 +47,7 @@ public class AbpAspNetCoreComponentsWebAssemblyModule : AbpModule public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) { await context.ServiceProvider.GetRequiredService().InitializeAsync(); + await context.ServiceProvider.GetRequiredService().InitializeAsync(); await SetCurrentLanguageAsync(context.ServiceProvider); }