chore: 优化AgileConfig配置

This commit is contained in:
2025-10-23 13:35:35 +08:00
parent e79925f402
commit 2360504491
3 changed files with 6 additions and 12 deletions

View File

@ -1,6 +1,5 @@
using KonSoft.Admin; using KonSoft.Admin;
using KonSoft.Shared.Hosting.Gateways; using KonSoft.Shared.Hosting.Gateways;
using Volo.Abp;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
namespace KonSoft.InternalGateway namespace KonSoft.InternalGateway
@ -11,8 +10,5 @@ namespace KonSoft.InternalGateway
)] )]
public class InternalGatewayModule : AbpModule public class InternalGatewayModule : AbpModule
{ {
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
}
} }
} }

View File

@ -1,8 +1,8 @@
using System; using KonSoft.Admin;
using KonSoft.Admin;
using KonSoft.Shared.Hosting.AspNetCore; using KonSoft.Shared.Hosting.AspNetCore;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Serilog; using Serilog;
using System;
var assemblyName = typeof(Program).Assembly.GetName().Name!; var assemblyName = typeof(Program).Assembly.GetName().Name!;

View File

@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Serilog; using Serilog;
@ -15,13 +14,12 @@ public static class ApplicationBuilderHelper
where TStartupModule : IAbpModule where TStartupModule : IAbpModule
{ {
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
builder.Configuration
.AddAgileConfig(option =>
{
option.ENV = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Development";
});
builder.Host builder.Host
.AddAppSettingsSecretsJson() .AddAppSettingsSecretsJson()
.UseAgileConfig(options =>
{
options.ENV = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Development";
})
.UseAutofac() .UseAutofac()
.UseSerilog(); .UseSerilog();