You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Services registered as part of a module later registered with the ConfigureModuleCatalog method cannot be resolved in the OnInitialized method.
However, services registered with RegisterTypes method are resolved correctly.__
Steps to Reproduce
Create a new MAUI single project app
Install latest Prism.DryIoc.Maui (9.0.537)
Create interface and implementation of that interface
Create implementation of IModule and register interface and it's implementation
Register IModule implementation in ConfigureModuleCatalog
Try to resolve service in OnInitialized
Example of solution that crashes on start when service is to be resolved: PrismBugReport.zip
Platform with bug
.NET MAUI
Affected platforms
Android
Did you find any workaround?
Workaround is to register service in RegisterTypes method which defeats the purpose of ConfigureModuleCatalog method.
Relevant log output
Prism.Ioc.ContainerResolutionException
Message=An unexpected error occurred while resolving 'PrismBugReport.IModuleService'
Source=Prism.Container.DryIoc
StackTrace:
at Prism.Container.DryIoc.DryIocContainerExtension.Resolve(Type type, ValueTuple`2[] parameters) in /_/src/Prism.Container.DryIoc/DryIocContainerExtension.cs:line 321 at Prism.Container.DryIoc.DryIocContainerExtension.Resolve(Type type) in /_/src/Prism.Container.DryIoc/DryIocContainerExtension.cs:line 292 at Prism.Ioc.IContainerProviderExtensions.Resolve[IModuleService](IContainerProvider provider) in /_/src/Prism.Container.Abstractions/IContainerProviderExtensions.cs:line 16 at PrismBugReport.MauiProgram.<>c.<<CreateMauiApp>b__0_4>d.MoveNext() in C:\Lab\PrismBugReport\PrismBugReport\MauiProgram.cs:line 28--- End of stack trace from previous location --- at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state) at Android.App.SyncContext.<>c__DisplayClass2_0.<Post>b__0() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.App/SyncContext.cs:line 36 at Java.Lang.Thread.RunnableImplementor.Run() in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:line 37 at Java.Lang.IRunnableInvoker.n_Run(IntPtr jnienv, IntPtr native__this) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net9.0/android-35/mcw/Java.Lang.IRunnable.cs:line 59 at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V(_JniMarshal_PP_V callback, IntPtr jnienv, IntPtr klazz) in /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:line 22
The text was updated successfully, but these errors were encountered:
Description
Services registered as part of a module later registered with the ConfigureModuleCatalog method cannot be resolved in the OnInitialized method.
However, services registered with RegisterTypes method are resolved correctly.__
Steps to Reproduce
Example of solution that crashes on start when service is to be resolved:
PrismBugReport.zip
Platform with bug
.NET MAUI
Affected platforms
Android
Did you find any workaround?
Workaround is to register service in RegisterTypes method which defeats the purpose of ConfigureModuleCatalog method.
Relevant log output
The text was updated successfully, but these errors were encountered: