I have this error on local debugging on a Windows machine and target an Android emulator (Pixel 5 - API 33)
My RegirsterInfrastructure:
static MauiAppBuilder RegisterInfrastructure(this MauiAppBuilder builder)
{
builder.Configuration.AddJsonPlatformBundle();
builder.Logging.AddSqlite(Path.Combine(FileSystem.AppDataDirectory, "logging.db"));
#if !MACCATALYST
builder.Logging.AddAppCenter(builder.Configuration["AppCenterKey"]);
#endif
#if DEBUG
builder.Logging.SetMinimumLevel(LogLevel.Trace);
builder.Logging.AddDebug();
#endif
var s = builder.Services;
s.AddSingleton(AudioManager.Current);
s.AddShinyService<AppStartup>();
s.AddShinyService<AppSettings>();
s.AddSingleton<Shiny.Example.Services.MySqliteConnection>();
s.AddJob(typeof(Shiny.Example.Delegates.MyJob));
s.AddBluetoothLE();
s.AddHttpTransfers<Shiny.Example.Delegates.MyHttpTransferDelegate>();
#if ANDROID
// if you want http transfers to also show up as progress notifications, include this
s.AddShinyService<Shiny.Net.Http.PerTransferNotificationStrategy>();
#endif
s.AddNotifications<Shiny.Example.Delegates.MyLocalNotificationDelegate>();
// TODO: Please make sure to add your proper connection string and hub name to appsettings.json or this will error on startup
s.AddPushAzureNotificationHubs<Shiny.Example.Delegates.MyPushDelegate>(
builder.Configuration["AzureNotificationHubs:ListenerConnectionString"],
builder.Configuration["AzureNotificationHubs:HubName"]
);
s.AddDataAnnotationValidation();
return builder;
}
Steps To Reproduce
I have configured a fresh new Shiny Template project Here are my PackageReference:
Issue (ie.Compiler Error)
My Application.Current is null on line 12 of the Start() method in AppSettings.cs file :
I have this error on local debugging on a Windows machine and target an Android emulator (Pixel 5 - API 33)
My RegirsterInfrastructure: