|
|
|
@ -1,6 +1,8 @@ |
|
|
|
using System.Reflection; |
|
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
using Microsoft.Extensions.FileProviders; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.Autofac; |
|
|
|
|
|
|
|
namespace MyCompanyName.MyProjectName; |
|
|
|
|
|
|
|
@ -8,7 +10,6 @@ public static class MauiProgram |
|
|
|
{ |
|
|
|
public static MauiApp CreateMauiApp() |
|
|
|
{ |
|
|
|
|
|
|
|
var builder = MauiApp.CreateBuilder(); |
|
|
|
builder |
|
|
|
.UseMauiApp<App>() |
|
|
|
@ -16,11 +17,13 @@ public static class MauiProgram |
|
|
|
{ |
|
|
|
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); |
|
|
|
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); |
|
|
|
}); |
|
|
|
}) |
|
|
|
.ConfigureContainer(new AbpAutofacServiceProviderFactory(new Autofac.ContainerBuilder())); |
|
|
|
|
|
|
|
ConfigureConfiguration(builder); |
|
|
|
|
|
|
|
builder.Services.AddApplication<MyProjectNameModule>(options => |
|
|
|
{ |
|
|
|
options.UseAutofac(); |
|
|
|
options.Services.ReplaceConfiguration(builder.Configuration); |
|
|
|
}); |
|
|
|
|
|
|
|
@ -30,4 +33,10 @@ public static class MauiProgram |
|
|
|
|
|
|
|
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); |
|
|
|
} |
|
|
|
} |