IOC using SimpleInjector fails on iOS for Xamarin Forms. Possible Xamarin Bug?

Hi,
I'm using simpleinjector for dependency injection on my Xamarin Forms project. We started testing stuff on Android initially and now have started working on iOS after stabilizing Android. We never expected IOC to cause an issue. This is the error that occurs.

 at SimpleInjector.InstanceProducer.BuildExpression () [0x0003d] in <215303bfc4464c2fb19e1665117477b4>:0 
  at SimpleInjector.Advanced.DefaultDependencyInjectionBehavior.BuildExpression (SimpleInjector.InjectionConsumerInfo consumer) [0x00012] in <215303bfc4464c2fb19e1665117477b4>:0 
  at SimpleInjector.ContainerOptions.BuildParameterExpression (SimpleInjector.InjectionConsumerInfo consumer) [0x00006] in <215303bfc4464c2fb19e1665117477b4>:0 
  at SimpleInjector.Registration.BuildConstructorParameterFor (SimpleInjector.InjectionConsumerInfo consumer) [0x00016] in <215303bfc4464c2fb19e1665117477b4>:0 
  at SimpleInjector.Registration.BuildConstructorParameters (System.Type serviceType, System.Type implementationType, System.Reflection.ConstructorInfo constructor) [0x0001f] in <215303bfc4464c2fb19e1665117477b4>:0 
  at SimpleInjector.Registration.BuildNewExpression (System.Type serviceType, System.Type implementationType) [0x0002c] in <215303bfc4464c2fb19e1665117477b4>:0 
  at SimpleInjector.Registration.BuildTransientExpression[TService,TImplementation] () [0x00000] in <215303bfc4464c2fb19e1665117477b4>:0 
  at SimpleInjector.Lifestyles.TransientLifestyle+TransientLifestyleRegistration`2[TService,TImplementation].BuildExpression () [0x00000] in <215303bfc4464c2fb19e1665117477b4>:0 
  at SimpleInjector.Registration.BuildExpression (SimpleInjector.InstanceProducer producer) [0x00007] in <215303bfc4464c2fb19e1665117477b4>:0 
  at SimpleInjector.InstanceProducer.BuildExpressionInternal () [0x00011] in <215303bfc4464c2fb19e1665117477b4>:0 
  at System.Lazy`1[T].CreateValue () [0x00075] in /Users/builder/data/lanes/3969/44931ae8/source/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono/mcs/class/referencesource/mscorlib/system/Lazy.cs:437 

This the code which we use for registration. Registration Code

Now, is this an issue with SimpleInjector or is it a Xamarin Bug?

Sign In or Register to comment.