runtime: Release System.ExecutionEngineException Blazor Hybrid iOS ComponentProperties.SetProperties(in ParameterView, object)+SetProperty(object, PropertySetter, string, object)
Description
having a Release only issue with Components on MAUI Blazor Hybrid. Starting getting this error after pushing my app to the App Store. Apparently the testers set it off nearly a hundred times in 10 minutes.
System.ExecutionEngineException: Attempting to JIT compile method '(wrapper delegate-invoke) void <Module>:invoke_callvirt_void_BindableT`1<string>_string (TallyIO.Client.Components.Inputs.Shared.BindableT`1<string>,string)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
?, in void PropertySetter.CallPropertySetter<BindableT<string>, string>(Action<BindableT<string>, string> setter, object target, object value)
?, in void PropertySetter.SetValue(object, object)
?, in void ComponentProperties.SetProperties(in ParameterView, object)+SetProperty(object, PropertySetter, string, object)
System.InvalidOperationException: Unable to set property 'ThisRef' on object of type 'TallyIO.Client.Components.Inputs.Shared.BindableT`1[[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]'.
The error was: Attempting to JIT compile method '(wrapper delegate-invoke) void <Module>:invoke_callvirt_void_BindableT`1<string>_string (TallyIO.Client.Components.Inputs.Shared.BindableT`1<string>,string)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
?, in void ComponentProperties.SetProperties(in ParameterView, object)+SetProperty(object, PropertySetter, string, object)
?, in void ComponentProperties.SetProperties(in ParameterView, object)
?, in Task ComponentBase.SetParametersAsync(ParameterView parameters)
?, in async Task TallyComponent.SetParametersAsync(ParameterView parameters)
?, in void IpcSender.NotifyUnhandledException(Exception exception)+() => { } [1]
?, in Task<T> DispatcherExtensions.DispatchAsync<T>(IDispatcher dispatcher, Func<T> func)+() => { } x 2
Steps to Reproduce
Run New MAUI Hybrid app in release, set properties on a component that uses Generics for implementation.
Version with bug
6.0.486 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS, macOS
Affected platform versions
iOS 15.5 is what I’ve seen so far.
Did you find any workaround?
No
Relevant log output
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 25 (17 by maintainers)
@naricc in this issue (already related) you can find a minimal repo to try: https://github.com/dotnet/maui/issues/9176
I believe the problem here is that ASP.NET is creating generic delegates here which requires JIT. https://github.com/dotnet/aspnetcore/blob/c85baf8db0c72ae8e68643029d514b2e737c9fae/src/Components/Components/src/Reflection/PropertySetter.cs#L31-L36
@agocke is there something that ASP.NET Or the application can do to tell the AOT tooling to pre-generate this delegate?
Moving to runtime because this problem appears to be specific to AOT.