fix: Arg_GetMethNotFnd exception in MAUI Blazor maccatalyst release mode
vinidiktov opened this issue Β· comments
π Bug Report
A MAUI Blazor app targeting MacCatalyst built in release mode throws an Arg_GetMethNotFnd exception when clicking on a navigation item.
π» Repro or Code Sample
See attached project file.
MauiBlazorFluentApp1.zip
π€ Expected Behavior
- Build a MAUI Blazor app in release mode:
dotnet build -f net8.0-maccatalyst -c Release - Launch the app.
- Click on a link in the nav bar.
- The page linked to from the nav bar is displayed.
π― Current Behavior
- Build a MAUI Blazor app with a nav bar and linked pages in release mode:
dotnet build -f net8.0-maccatalyst -c Release - Launch the app.
- Click on a link in the nav bar.
- A System.Argument exception (Arg_GetMethNotFnd) is thrown.
π¦ Context
The app works fine in debug mode but breaks in release mode.
π Your Environment
- OS & Device: macOS Sonoma 14.3.1, MacBook Air M1
- Browser: Safari WebView in MAUI Blazor
- .NET and Fluent UI Blazor library Version: .NET 8.0.201, Fluent UI Blazor 4.4.1, .NET MAUI 8.0.7, maccatalyst 17.2
Hi,
Unfoirtunately, I do not have access to a Mac environment to test this on.
Going by the error message, it goes wrong in ListComponentBase
. That is being used by the on the home page. I don't have a clue as to why that exactly is using reflection. Maybe you can do some testing with disabling Trimming?
Hello,
I've tried setting the <MtouchLink>None</MtouchLink>
property in the project file but when I launch the app it crashes.
<Mtouchlink>
is not something from us. Can;t help you with that.
What I meant is add something like this to the project file:
<ItemGroup>
<TrimmerRootAssembly Include="Microsoft.FluentUI.AspNetCore.Components" />
</ItemGroup>
See also #1057. As this is not downloading assemblies like a regular WebAssembly app, you might consider to turn trimming of completely.
<Mtouchlink>
is not something from us. Can;t help you with that.What I meant is add something like this to the project file:
<ItemGroup> <TrimmerRootAssembly Include="Microsoft.FluentUI.AspNetCore.Components" /> </ItemGroup>
See also #1057. As this is not downloading assemblies like a regular WebAssembly app, you might consider to turn trimming of completely.
This has worked. Thanks, Vincent!