System.InvalidOperationException: The default service provider has already been configured
at Microsoft.Toolkit.Mvvm.DependencyInjection.Ioc.ThrowInvalidOperationExceptionForRepeatedConfiguration () [0x00000] in //Microsoft.Toolkit.Mvvm/DependencyInjection/Ioc.cs:164
at Microsoft.Toolkit.Mvvm.DependencyInjection.Ioc.ConfigureServices (System.IServiceProvider serviceProvider) [0x0000f] in //Microsoft.Toolkit.Mvvm/DependencyInjection/Ioc.cs:139
at CSLightsMVVM.App..ctor () [0x00009] in C:\Users\Tom\source\repos\CSLightsMVVM\CSLightsMVVM\CSLightsMVVM\App.xaml.cs:29
The problem is that Ioc.Default object is instantiated itself and apparently not destroyed after MainActivity.OnDestroy() is called. Then, when user return app from stack, App ctor is run again and there no way to check if Ioc.Default had been already configured or not.
System.InvalidOperationException: The default service provider has already been configured at Microsoft.Toolkit.Mvvm.DependencyInjection.Ioc.ThrowInvalidOperationExceptionForRepeatedConfiguration () [0x00000] in //Microsoft.Toolkit.Mvvm/DependencyInjection/Ioc.cs:164 at Microsoft.Toolkit.Mvvm.DependencyInjection.Ioc.ConfigureServices (System.IServiceProvider serviceProvider) [0x0000f] in //Microsoft.Toolkit.Mvvm/DependencyInjection/Ioc.cs:139 at CSLightsMVVM.App..ctor () [0x00009] in C:\Users\Tom\source\repos\CSLightsMVVM\CSLightsMVVM\CSLightsMVVM\App.xaml.cs:29
The problem is that Ioc.Default object is instantiated itself and apparently not destroyed after MainActivity.OnDestroy() is called. Then, when user return app from stack, App ctor is run again and there no way to check if Ioc.Default had been already configured or not.