DryIoc: Xamarin Forms iOS System.PlatformNotSupportedException: Operation is not supported on this platform.
After upgrading to 4 from 3 registrations fail on iOS with System.PlatformNotSupportedException: Operation is not supported on this platform.
container.RegisterMany(new[] { typeof(CoreRegistry).GetTypeInfo().Assembly },
type => type.IsAssignableTo< IMenuProvider >(),
ifAlreadyRegistered: IfAlreadyRegistered.AppendNewImplementation);
I tried using .WithoutFastExpressionCompiler(); because JIT is not supported on iOS but the registration still threw the exception.
Version with issue: 4
Last known good version: 3
Xamarin.Forms version: 3.6.0.344457
IDE: Visual Studio 2019 Enterprise
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 36 (19 by maintainers)
Commits related to this issue
- fixing GetAssemblyTypes for #156 — committed to dadhi/DryIoc by dadhi 4 years ago
This isn’t fixed. On iOS on version 4.2 of the package, RegisterMany will just not work, even with .WithUseInterpretation and .WithoutFastExpressionCompiler.
@xleon I think that generally everything works, just keep in mind to set
WithUseInterpretation()rule for iOS.This issue is open to think and decide on should the interpretation have the compilation fallback or just fail. And this a thing only if you are using custom ExpressionFactory with the exotic expression not supported by the DryIoc interpreter.
My current choice is probably let it fail, because this is likely the indication of the client setup problem. Hiding it will produce more pain than profit.
@dadhi @OmidID I will give it a try. Thank you.
@xleon FYI: we are using DryIoc in a big project. After migration, we have better performance and lower memory usage.
Using Scope over (ViewController(iOS), Activity(Android), Page(XF))
@OmidID For iOS only. Try to use the default settings for Android.
I am very curious how is the FastExpressionCompiler relates to the problem, because WithUseInterperation don’t assume the compilation. The only thing I can imagine (except the bug) that the compilation used as a fallback when interpretation is failing, hmm…
I need probably to disable the fallback bacause it does not help when interpretation is the only option, and throw the relevant exception to make the problem visible.
@OmidID Try to add the interpretation too, because otherwise you are using System Compile and it may not work on the platform.
Xamarin.iOS should have
__IOS__for conditional compilation but personally I never used it. Conditional CompilationIn our apps we are using Device.RuntimePlatform from Xamarin.Forms. RuntimePlatform
DryIoc v4.2.1 is released with the bug-fix
@MilKAOS Thanks for the sample. Will look.