Replies: 1 comment
-
Maybe? https://learn.microsoft.com/en-us/dotnet/maui/macios/interpreter?view=net-maui-9.0 "If your .NET MAUI iOS app or ARM64-based Mac Catalyst app works correctly as a debug build but then crashes as a release build, try enabling the interpreter for your app's release build. It may be that your app, or one of its libraries, uses a feature that requires the interpreter." |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm developing a MAUI application using MediatR and the Query/Command pattern with Handlers. While everything works correctly in debug mode, my application stops responding when I attempt to send a query in release mode. I believe this is related to Ahead-of-Time (AOT) compilation trimming necessary code.
The whole project is available in my repository named Test (https://github.com/bober20/Test)
What I've already tried:
Explicitly registering each handler in my dependency injection setup:
services.AddTransient<IRequestHandler, Handler>();
true link true false true falseConfiguring the linker in my project file:
I get the following error in my debug mode:
MauiApp1[3132:1224716] error: * Assertion at /Users/runner/work/1/s/src/mono/mono/mini/mini-arm64.c:6876, condition `native_offset % 4 == 0' not met
Managed Stacktrace:
at <0xffffffff>
at System.Buffer:Memmove <0x00008>
at System.String:CopyStringContent <0x00064>
at System.String:Concat <0x00102>
at System.Reflection.InvokerEmitUtil:CreateInvokeDelegate_RefArgs <0x00168>
at System.Reflection.MethodInvokerCommon:DetermineStrategy_RefArgs <0x00094>
at System.Reflection.MethodBaseInvoker:InvokeWithNoArgs <0x00076>
at System.RuntimeType:CreateInstanceMono <0x00286>
at System.RuntimeType:CreateInstanceDefaultCtor <0x0008a>
at System.Activator:CreateInstance <0x000aa>
at System.Activator:CreateInstance <0x00028>
at System.Activator:CreateInstance <0x0001e>
at <>c__8
1:<Send>b__8_0 <0x0005e> at System.Collections.Concurrent.ConcurrentDictionary
2:GetOrAdd <0x00130>at MediatR.Mediator:Send <0x000b4>
at d__6:MoveNext <0x001da>
at System.Runtime.CompilerServices.AsyncMethodBuilderCore:Start <0x00094>
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start <0x00016>
at MauiApp1.MainViewModel:CreateEntity <0x00084>
at CommunityToolkit.Mvvm.Input.AsyncRelayCommand:ExecuteAsync <0x0004a>
at CommunityToolkit.Mvvm.Input.AsyncRelayCommand:Execute <0x00026>
at Microsoft.Maui.Controls.ButtonElement:ElementClicked <0x00088>
at Microsoft.Maui.Controls.Button:SendClicked <0x00020>
at Microsoft.Maui.Controls.Button:Microsoft.Maui.IButton.Clicked <0x0001e>
at ButtonEventProxy:OnButtonTouchUpInside <0x0007a>
at UIKit.UIControlEventProxy:Activated <0x0005e>
at Registrar_Callbacks:callback_3188_UIKit_UIControlEventProxy_Activated <0x0005c>
at Registrar_Callbacks:callback_3188_UIKit_UIControlEventProxy_Activated <0x0009e>
at <0x00000>
at <0xffffffff>
at UIKit.UIApplication:xamarin_UIApplicationMain <0x000b8>
at UIKit.UIApplication:UIApplicationMain <0x0006e>
at UIKit.UIApplication:Main <0x00152>
at MauiApp1.Program:Main <0x0002c>
at :runtime_invoke_direct_void_string[] <0x0007e>
at <0x00000>
Has anyone encountered similar issues with MAUI release builds and query/command patterns? What solutions worked for you?
Beta Was this translation helpful? Give feedback.
All reactions