You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.4 KiB
44 lines
1.4 KiB
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.FileProviders;
|
|
using Microsoft.Extensions.Logging;
|
|
using System.Reflection;
|
|
using Volo.Abp;
|
|
using Volo.Abp.Autofac;
|
|
|
|
namespace LINGYUN.Abp.Applications;
|
|
public static class MauiProgram
|
|
{
|
|
public static MauiApp CreateMauiApp()
|
|
{
|
|
var builder = MauiApp.CreateBuilder();
|
|
builder
|
|
.UseMauiApp<App>()
|
|
.ConfigureFonts(fonts =>
|
|
{
|
|
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
|
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
|
|
})
|
|
.ConfigureContainer(new AbpAutofacServiceProviderFactory(new Autofac.ContainerBuilder()));
|
|
|
|
ConfigureConfiguration(builder);
|
|
|
|
builder.Services.AddApplication<AbpApplicationsModule>(options =>
|
|
{
|
|
options.Services.ReplaceConfiguration(builder.Configuration);
|
|
});
|
|
|
|
var app = builder.Build();
|
|
|
|
app.Services
|
|
.GetRequiredService<IAbpApplicationWithExternalServiceProvider>()
|
|
.Initialize(app.Services);
|
|
|
|
return app;
|
|
}
|
|
|
|
private static void ConfigureConfiguration(MauiAppBuilder builder)
|
|
{
|
|
var assembly = typeof(App).GetTypeInfo().Assembly;
|
|
builder.Configuration.AddJsonFile(new EmbeddedFileProvider(assembly), "appsettings.json", optional: false, false);
|
|
}
|
|
}
|
|
|