Need to resolve a dependency in CreateMauiApp()
method in MauiProgram.cs
?
If you google around you find you need to get an instance of IServiceProvider, this can be achived using the snippet bellow
var serviceProvider = builder.Services.BuildServiceProvider();
var myService = serviceProvider.GetService<MyService>()
MauiProgram.cs
Top comments (0)