microsoft / fluentui-blazor

Microsoft Fluent UI Blazor components library. For use with ASP.NET Core Blazor applications

Home Page:https://www.fluentui-blazor.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  1. Build a MAUI Blazor app in release mode:
    dotnet build -f net8.0-maccatalyst -c Release
  2. Launch the app.
  3. Click on a link in the nav bar.
  4. The page linked to from the nav bar is displayed.

😯 Current Behavior

  1. Build a MAUI Blazor app with a nav bar and linked pages in release mode:
    dotnet build -f net8.0-maccatalyst -c Release
  2. Launch the app.
  3. Click on a link in the nav bar.
  4. A System.Argument exception (Arg_GetMethNotFnd) is thrown.
Screenshot 2024-03-06 at 09 17 01

πŸ”¦ 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.

stack-trace.txt

<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!