You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
What I've already tried:
Explicitly registering each handler in my dependency injection setup:
services.AddTransient<IRequestHandler, Handler>();
Configuring the linker in my project file:
true
link
true
false
true
false
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 <unknown> <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 <CreateEntity>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 <unknown> <0x00000>
at <unknown> <0xffffffff>
at UIKit.UIApplication:xamarin_UIApplicationMain <0x000b8>
at UIKit.UIApplication:UIApplicationMain <0x0006e>
at UIKit.UIApplication:Main <0x00152>
at MauiApp1.Program:Main <0x0002c>
at <Module>:runtime_invoke_direct_void_string[] <0x0007e>
at <unknown> <0x00000>
Has anyone encountered similar issues with MAUI release builds and query/command patterns? What solutions worked for you?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
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:
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