Q: TinyIoC AoT work around
We are currently using TinyIoC source embedded in a Maui / .net 9 project.
As part of upgrade tests from .net 8 to 9, a release iOS build crashes out upon launch, whereas the debug launch works normally. There is a flag that can be added to check if all is OK for Ahead of Time (AOT) compilation: IsAotCompatible. When that flag is used, it generates out the below warnings. I put in the option MtouchInterpreter>-all</MtouchInterpreter , which gets the release iOS build passed the crash initial crash.
I was wondering for those using Maui, .net 9 and TinyIoC, what was your work around?
TinyIoc.cs(614,31): warning IL3050: Using member 'System.Reflection.MethodInfo.MakeGenericMethod(params Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime. TinyIoc.cs(3969,29): warning IL3050: Using member 'System.Linq.Expressions.Expression.Lambda(Expression, params ParameterExpression[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Delegate creation requires dynamic code generation. TinyIoc.cs(3991,29): warning IL3050: Using member 'System.Linq.Expressions.Expression.Lambda(Expression, params ParameterExpression[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Delegate creation requires dynamic code generation. TinyIoc.cs(4017,91): warning IL3050: Using member 'System.Linq.Expressions.Expression.Call(Type, String, Type[], params Expression[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Calling a generic method requires dynamic code generation. This can be suppressed if the method is not generic. TinyIoc.cs(4019,29): warning IL3050: Using member 'System.Linq.Expressions.Expression.Lambda(Expression, params ParameterExpression[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. Delegate creation requires dynamic code generation. TinyIoc.cs(4475,18): warning IL3050: Using member 'System.Type.MakeGenericType(params Type[])' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. The native code for this instantiation might not be available at runtime.