Thanks a lot for maliming's help, a redundant module depends caused an odd bug
That is right, my local environment debug already configured it as you suggested
here is the API app program file code:
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt", rollingInterval: RollingInterval.Day))
.WriteTo.Async(c => c.Console())
.CreateBootstrapLogger();
try
{
Log.Information($"Starting {GetCurrentAssemblyName()}");
AbpStudioEnvironmentVariableLoader.Load();
var builder = WebApplication.CreateBuilder(args);
builder.Host
.AddAppSettingsSecretsJson()
.UseAutofac()
.UseSerilog((context, services, loggerConfiguration) =>
{
var applicationName = services.GetRequiredService<IApplicationInfoAccessor>().ApplicationName;
loggerConfiguration
#if DEBUG
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.Enrich.WithProperty("Application", applicationName)
.If(context.Configuration.GetValue<bool>("ElasticSearch:IsLoggingEnabled"), c =>
c.WriteTo.Elasticsearch(
new ElasticsearchSinkOptions(new Uri(context.Configuration["ElasticSearch:Url"]!))
{
AutoRegisterTemplate = true,
AutoRegisterTemplateVersion = AutoRegisterTemplateVersion.ESv6,
IndexFormat = "PointLink-log-{0:yyyy.MM}"
})
)
.WriteTo.Async(c => c.File("Logs/logs.txt", rollingInterval: RollingInterval.Day))
.WriteTo.Async(c => c.Console())
.WriteTo.Async(c => c.AbpStudio(services));
});
await builder.AddApplicationAsync<PointLinkAdministrationServiceModule>();
var app = builder.Build();
await app.InitializeApplicationAsync();
await app.RunAsync();
Log.Information($"Stopped {GetCurrentAssemblyName()}");
return 0;
}
catch (HostAbortedException)
{
/* Ignoring this exception because: https://github.com/dotnet/efcore/issues/29809#issuecomment-1345132260 */
return 2;
}
catch (Exception ex)
{
Console.WriteLine($"{GetCurrentAssemblyName()} terminated unexpectedly!");
Console.WriteLine(ex.ToString());
Console.WriteLine(ex.StackTrace ?? "");
Log.Fatal(ex, $"{GetCurrentAssemblyName()} terminated unexpectedly!");
Log.Fatal(ex.Message);
Log.Fatal(ex.StackTrace ?? "");
return 1;
}
finally
{
await Log.CloseAndFlushAsync();
}
}
below are the logs after add debug info follow up your suggestion, it seems no more info logged
2025-07-22 20:19:27.918 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:44357/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0 - null null 2025-07-22 20:19:27.924 +08:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)' 2025-07-22 20:19:27.924 +08:00 [INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationConfiguration", page = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto] GetAsync(Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationRequestOptions) on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController (Volo.Abp.AspNetCore.Mvc).
2025-07-22 20:19:27.928 +08:00 [WRN] The cookie 'XSRF-TOKEN' has set 'SameSite=None' and must also set 'Secure'.
2025-07-22 20:19:27.928 +08:00 [DBG] Executing AbpApplicationConfigurationAppService.GetAsync()...
2025-07-22 20:19:28.050 +08:00 [DBG] Executed AbpApplicationConfigurationAppService.GetAsync().
2025-07-22 20:19:28.050 +08:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto'.
2025-07-22 20:19:28.051 +08:00 [INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 126.2675ms
2025-07-22 20:19:28.051 +08:00 [INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2025-07-22 20:19:28.051 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:44357/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0 - 200 null application/json; charset=utf-8 132.6133ms
2025-07-22 20:19:28.052 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:44357/api/abp/application-localization?CultureName=zh-Hans&OnlyDynamics=True&api-version=1.0 - null null
2025-07-22 20:19:28.059 +08:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2025-07-22 20:19:28.059 +08:00 [INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationLocalization", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationDto] GetAsync(Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationRequestDto) on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController (Volo.Abp.AspNetCore.Mvc).
2025-07-22 20:19:28.365 +08:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationDto'.
2025-07-22 20:19:28.365 +08:00 [INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 305.6032ms
2025-07-22 20:19:28.365 +08:00 [INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2025-07-22 20:19:28.365 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:44357/api/abp/application-localization?CultureName=zh-Hans&OnlyDynamics=True&api-version=1.0 - 200 null application/json; charset=utf-8 312.3666ms
`
This is the related logs:
2025-07-22 18:43:50.418 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:44357/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0 - null null
2025-07-22 18:43:50.423 +08:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2025-07-22 18:43:50.423 +08:00 [INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationConfiguration", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto] GetAsync(Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationRequestOptions) on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController (Volo.Abp.AspNetCore.Mvc).
2025-07-22 18:43:50.424 +08:00 [WRN] The cookie 'XSRF-TOKEN' has set 'SameSite=None' and must also set 'Secure'.
2025-07-22 18:43:50.425 +08:00 [DBG] Executing AbpApplicationConfigurationAppService.GetAsync()...
2025-07-22 18:43:50.504 +08:00 [DBG] Executed AbpApplicationConfigurationAppService.GetAsync().
2025-07-22 18:43:50.504 +08:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto'.
2025-07-22 18:43:50.504 +08:00 [INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 81.1573ms
2025-07-22 18:43:50.504 +08:00 [INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2025-07-22 18:43:50.504 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:44357/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0 - 200 null application/json; charset=utf-8 85.8399ms
2025-07-22 18:43:50.506 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:44357/api/abp/application-localization?CultureName=zh-Hans&OnlyDynamics=True&api-version=1.0 - null null
2025-07-22 18:43:50.509 +08:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2025-07-22 18:43:50.509 +08:00 [INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationLocalization", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationDto] GetAsync(Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationRequestDto) on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController (Volo.Abp.AspNetCore.Mvc).
2025-07-22 18:43:50.704 +08:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationDto'.
2025-07-22 18:43:50.704 +08:00 [INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 194.5464ms
2025-07-22 18:43:50.704 +08:00 [INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2025-07-22 18:43:50.704 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:44357/api/abp/application-localization?CultureName=zh-Hans&OnlyDynamics=True&api-version=1.0 - 200 null application/json; charset=utf-8 198.4203ms
2025-07-22 18:43:51.055 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:44357/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0 - null null
2025-07-22 18:43:51.059 +08:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2025-07-22 18:43:51.059 +08:00 [INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationConfiguration", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto] GetAsync(Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationRequestOptions) on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController (Volo.Abp.AspNetCore.Mvc).
2025-07-22 18:43:51.060 +08:00 [WRN] The cookie 'XSRF-TOKEN' has set 'SameSite=None' and must also set 'Secure'.
2025-07-22 18:43:51.060 +08:00 [DBG] Executing AbpApplicationConfigurationAppService.GetAsync()...
2025-07-22 18:43:51.129 +08:00 [DBG] Executed AbpApplicationConfigurationAppService.GetAsync().
2025-07-22 18:43:51.129 +08:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto'.
2025-07-22 18:43:51.129 +08:00 [INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 69.8878ms
2025-07-22 18:43:51.129 +08:00 [INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2025-07-22 18:43:51.129 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:44357/api/abp/application-configuration?IncludeLocalizationResources=False&api-version=1.0 - 200 null application/json; charset=utf-8 73.6633ms
2025-07-22 18:43:51.130 +08:00 [INF] Request starting HTTP/1.1 GET http://localhost:44357/api/abp/application-localization?CultureName=zh-Hans&OnlyDynamics=True&api-version=1.0 - null null
2025-07-22 18:43:51.134 +08:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2025-07-22 18:43:51.134 +08:00 [INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationLocalization", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationDto] GetAsync(Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationRequestDto) on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController (Volo.Abp.AspNetCore.Mvc).
2025-07-22 18:43:51.324 +08:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationLocalizationDto'.
2025-07-22 18:43:51.324 +08:00 [INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 190.6994ms
2025-07-22 18:43:51.324 +08:00 [INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationLocalizationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2025-07-22 18:43:51.324 +08:00 [INF] Request finished HTTP/1.1 GET http://localhost:44357/api/abp/application-localization?CultureName=zh-Hans&OnlyDynamics=True&api-version=1.0 - 200 null application/json; charset=utf-8 194.0796ms
The Auth and CurrentUser both are null
2025-07-22 17:10:19.277 +08:00 [INF] MVC Cached Application Configuration: Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto 2025-07-22 17:10:19.279 +08:00 [INF] MVC Cached Application Configuration Auth: [] 2025-07-22 17:10:19.281 +08:00 [INF] MVC Cached Application Configuration CurrentUser: null
It seems even the menu doesn't appears, the Auth and Localization not retrieved values
` 2025-07-22 17:03:26.535 +08:00 [INF] MVC Cached Application Configuration: Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto 2025-07-22 17:03:26.536 +08:00 [INF] MVC Cached Application Configuration Auth: {} 2025-07-22 17:03:26.537 +08:00 [INF] MVC Cached Application Configuration Features: {"TextManagement.Enable":"true","SettingManagement.Enable":"true","SettingManagement.AllowChangingEmailSettings":"false","LeptonXManagement.Enable":"true","CmsKit.BlogEnable":"true","CmsKit.CommentEnable":"true","CmsKit.GlobalResourceEnable":"true","CmsKit.MenuEnable":"true","CmsKit.PageEnable":"true","CmsKit.RatingEnable":"true","CmsKit.ReactionEnable":"true","CmsKit.TagEnable":"true","CmsKit.MarkedItemEnable":"true","CmsKitPro.ContactEnable":"true","CmsKitPro.NewsletterEnable":"true","CmsKitPro.PollEnable":"true","CmsKitPro.UrlShortingEnable":"true","CmsKitPro.PageFeedbackEnable":"true","CmsKitPro.FaqEnable":"true","Identity.TwoFactor":"Optional","Identity.MaxUserCount":"0","Account.EnableLdapLogin":"False","Identity.EnableOAuthLogin":"False","LanguageManagement.Enable":"true","AuditLogging.Enable":"true","AuditLogging.SettingManagement":"false"} 2025-07-22 17:03:26.538 +08:00 [INF] MVC Cached Application Configuration Localization: {} 2025-07-22 17:03:26.538 +08:00 [INF] MVC Cached Application Configuration Setting: {"Abp.Localization.DefaultLanguage":"zh-Hans;zh-Hans","Abp.Timing.TimeZone":"","Volo.Abp.LeptonXTheme.ApplicationLayout":"SideMenu","CmsKit.Comments.RequireApprovement":"false","Volo.CmsKitPro.ContactReceiverEmailAddress":"info@mycompanyname.com","Volo.CmsKitPro.PageFeedbackIsAutoHandled":"True","Volo.CmsKitPro.PageFeedbackRequireCommentsForNegativeFeedback":"False","Volo.Saas.EnableTenantBasedConnectionStringManagement":"False","Abp.Identity.Password.RequiredLength":"6","Abp.Identity.Lockout.MaxFailedAccessAttempts":"5","Abp.Identity.Password.RequireDigit":"False","Abp.Identity.SignIn.RequireConfirmedPhoneNumber":"False","Abp.Identity.Lockout.LockoutDuration":"300","Abp.Identity.Password.PasswordChangePeriodDays":"0","Abp.Identity.Password.ForceUsersToPeriodicallyChangePassword":"False","Abp.Identity.SignIn.RequireConfirmedEmail":"False","Abp.Identity.User.IsUserNameUpdateEnabled":"True","Abp.Identity.Session.PreventConcurrentLogin":"Disabled","Abp.Identity.User.IsEmailUpdateEnabled":"True","Abp.Identity.Lockout.AllowedForNewUsers":"True","Abp.Identity.Password.RequireUppercase":"False","Abp.Identity.SignIn.EnablePhoneNumberConfirmation":"True","Abp.Identity.TwoFactor.UsersCanChange":"True","Abp.Identity.OrganizationUnit.MaxUserMembershipCount":"2147483647","Abp.Identity.Password.RequireNonAlphanumeric":"False","Abp.Identity.TwoFactor.Behaviour":"Optional","Abp.Identity.Password.RequiredUniqueChars":"1","Abp.Identity.Password.RequireLowercase":"False","Abp.Account.Idle.Enabled":"True","Abp.Account.Captcha.SiteKey":null,"Abp.Account.Captcha.UseCaptchaOnLogin":"false","Abp.Account.TwoFactorLogin.IsRememberBrowserEnabled":"true","Abp.Account.Captcha.Score":"0.5","Abp.Account.Idle.IdleTimeoutMinutes":"60","Abp.Account.IsSelfRegistrationEnabled":"true","Abp.Account.Captcha.VerifyBaseUrl":"https://www.google.com/","Abp.Account.ProfilePictureSource":"False","Abp.Account.EnableLocalLogin":"true","Abp.Account.PreventEmailEnumeration":"false","Abp.Account.Captcha.UseCaptchaOnRegistration":"false","Abp.Account.VerifyPasswordDuringExternalLogin":"False","Abp.Account.Captcha.Version":"3","EasyAbp.EShop.Products.Product.DefaultPaymentExpireIn":"00:15:00"} 2025-07-22 17:03:26.540 +08:00 [INF] Initialized all ABP modules.
`
the get service method doesn't work here context.Services.GetRequiredService<>, any other method to inject a service here?
spublic override void PostConfigureServices(ServiceConfigurationContext context)
{
var logger = context.Services.GetRequiredService<ILogger<PointLinkWebModule>>();
var mvcCachedApplicationConfigurationClient = context.Services.GetRequiredService<MvcCachedApplicationConfigurationClient>();
var mvcCachedApplicationConfiguration = mvcCachedApplicationConfigurationClient.GetAsync().GetAwaiter().GetResult();
if (mvcCachedApplicationConfiguration != null)
{
logger.LogInformation("MVC Cached Application Configuration: {Configuration}", mvcCachedApplicationConfiguration);
//foreach (var configuration in mvcCachedApplicationConfiguration.)
//{
// logger.LogInformation("mvcCachedApplicationConfiguration value: {Value}", configuration.Value);
//}
}
else
{
logger.LogWarning("MVC Cached Application Configuration is null.");
}
}
```
I did this, cannot inject the service
Is there a entry point to override the MvcCachedApplicationConfigurationClient class? Not found a configure point for this